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

Rename LayoutVerified to Ref #68

Closed
joshlf opened this issue Oct 15, 2022 · 2 comments · Fixed by #203
Closed

Rename LayoutVerified to Ref #68

joshlf opened this issue Oct 15, 2022 · 2 comments · Fixed by #203
Labels
blocking-next-release This issue should be resolved before we release on crates.io

Comments

@joshlf
Copy link
Member

joshlf commented Oct 15, 2022

The LayoutVerified type wraps a byte slice reference. It is a witness type that guarantees that the length and alignment have been validated to be compatible with a type parameter, T. It's named based on this witness role (the layout has been "verified"), but the name is confusing for consumers. We should rename it to Ref or similar - it's a reference type that enables zero-copy operations, hence zerocopy::Ref.

@joshlf joshlf added the blocking-next-release This issue should be resolved before we release on crates.io label Oct 15, 2022
@MSalah73
Copy link
Contributor

I'll take this one

@joshlf
Copy link
Member Author

joshlf commented Oct 16, 2022

Hi @MSalah73 , this one isn't ready for contribution yet unfortunately - I'm going to need to go through and make sure that this change doesn't break anything in Fuchsia. Once I've done that, I'll add the good first issue Good for newcomers label. In the meantime, check out that label for stuff that we need help with!

@joshlf joshlf mentioned this issue Oct 23, 2022
joshlf added a commit that referenced this issue Jul 29, 2023
While `LayoutVerified` is technically a descriptive name, it doesn't
give much of a hint as to what the type's intended use is. The way it is
used in practice is as a sort of "smart" reference - the only difference
from a native reference (`&` or `&mut`) is that it is generic over the
mutability of the byte slice from which it was constructed. Thus, `Ref`
is a more helpful and informative name.

Closes #68
joshlf added a commit that referenced this issue Aug 2, 2023
While `LayoutVerified` is technically a descriptive name, it doesn't
give much of a hint as to what the type's intended use is. The way it is
used in practice is as a sort of "smart" reference - the only difference
from a native reference (`&` or `&mut`) is that it is generic over the
mutability of the byte slice from which it was constructed. Thus, `Ref`
is a more helpful and informative name.

Closes #68
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocking-next-release This issue should be resolved before we release on crates.io
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants