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

Implement AsRef and AsMut instances for repr(uN) bitfields #63

Open
ollie-etl opened this issue Apr 14, 2021 · 2 comments
Open

Implement AsRef and AsMut instances for repr(uN) bitfields #63

ollie-etl opened this issue Apr 14, 2021 · 2 comments

Comments

@ollie-etl
Copy link

For repr(uN) bitfields, it'd be helpful to be able to view a reference to the bitfield as a reference to the representation type without copy.

The opposite is also true - there are occasions when I'd like to operate on a primitive type as though it were a bitfield.

@ollie-etl
Copy link
Author

I'm happy to submit a RP if this is considered desirable ^

@ollie-etl
Copy link
Author

I can't think of an implementation not requiring unsafe. Stdlib functions i.e. from_ne_byes copy.

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

1 participant