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 IntoBytes for Cell<T: IntoBytes> #1253

Open
jswrenn opened this issue May 13, 2024 · 1 comment
Open

Implement IntoBytes for Cell<T: IntoBytes> #1253

jswrenn opened this issue May 13, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@jswrenn
Copy link
Collaborator

jswrenn commented May 13, 2024

I believe we can implement IntoBytes for Cell<T: IntoBytes>. Per Cell's documentation:

Memory layout

Cell<T> has the same memory layout and caveats as UnsafeCell. In particular, this means that Cell has the same in-memory representation as its inner type T.

— from https://doc.rust-lang.org/std/cell/struct.Cell.html#memory-layout

@jswrenn jswrenn added the enhancement New feature or request label May 13, 2024
@jswrenn
Copy link
Collaborator Author

jswrenn commented May 14, 2024

It looks like we can essentially copy the implementations of TransparentWrapper, TryFromBytes and other traits for UnsafeCell, but I can't quite make our TryFromBytes testing infra happy.

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

No branches or pull requests

1 participant