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

Use the :vis fragment specifier #20

Open
dzamlo opened this issue Oct 26, 2018 · 3 comments
Open

Use the :vis fragment specifier #20

dzamlo opened this issue Oct 26, 2018 · 3 comments

Comments

@dzamlo
Copy link
Owner

dzamlo commented Oct 26, 2018

No description provided.

@dzamlo dzamlo changed the title Use the :vis fragment specifier Use the :vis fragment specifier Oct 26, 2018
@TheDan64
Copy link

TheDan64 commented Nov 7, 2018

Would this allow you to add visibility modifiers to methods? IE u8, pub foo, pub set_foo: x, y; I can't seem to access the methods from other modules since they are private

@dzamlo
Copy link
Owner Author

dzamlo commented Nov 7, 2018

You can already add a pub modifier to a field. This will make the two method public. There is an example in the bitfield_fields documentation.

The goal of this issue is to simplify the code and support the more advanced visibility modifier like pub(crate).

@ithinuel
Copy link
Contributor

Would it be acceptable to also make the content not pub by default (or at least to opt-out from it)?

That’d allow to enforce valid values eg with TryFrom<u8> and avoid users inadventenly crating incorrect instances.

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

3 participants