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

Conversion between Box<T: Unalign> and Box<[u8]> #2258

Open
kupiakos opened this issue Jan 23, 2025 · 0 comments
Open

Conversion between Box<T: Unalign> and Box<[u8]> #2258

kupiakos opened this issue Jan 23, 2025 · 0 comments

Comments

@kupiakos
Copy link
Contributor

There's no safe way to no-op convert between allocated bytes and allocated T when T is unaligned and FromBytes + IntoBytes. An Immutable bound is not needed in any case because Box is non-aliasing like &mut.

Future design thinking: what about Rc and Arc? Why is there not impl ByteSlice for Box<T> so it can be used in Ref with looser requirements (T: Unalign is no longer needed)?

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