Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Private fields of a generated struct needs to be public #336

Closed
jamesray1 opened this issue Sep 17, 2018 · 2 comments
Closed

Private fields of a generated struct needs to be public #336

jamesray1 opened this issue Sep 17, 2018 · 2 comments

Comments

@jamesray1
Copy link
Contributor

jamesray1 commented Sep 17, 2018

I was trying to make an adjustment to the rust-libp2p codebase which uses rust-protobuf, however got a few compiler errors, one of which is due to a private field of a public struct in a generated rpc_proto.rs file: [rustc] field `name` of struct `rpc_proto::TopicDescriptor` is private. The problem is that this field needs to be public in order to use it for the topic ID in rust-libp2p. FMI see libp2p/rust-libp2p#473 (comment).

jamesray1 added a commit to jamesray1/rust-libp2p that referenced this issue Sep 17, 2018
…opic.descriptor to public, and file an issue for the name field in TopicDescriptor to set it to public: stepancheg/rust-protobuf#336
@tomaka
Copy link

tomaka commented Sep 17, 2018

You should be able to use .get_name() instead of .name

@jamesray1
Copy link
Contributor Author

Thanks, that indeed works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants