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

Add KnownLayout trait #347

Merged

Conversation

joshlf
Copy link
Member

@joshlf joshlf commented Sep 7, 2023

In its initial form, the KnownLayout trait encodes type layout information slightly more complex than can be gleaned from any arbitrary T: ?Sized. This allows it to support not just sized and slice types, but also "custom DSTs" (those with fixed-size fields followed by a trailing slice type). This is the first step to supporting various operations on arbitrary custom DSTs.

Makes progress on #29

@joshlf joshlf requested a review from jswrenn September 7, 2023 18:31
@joshlf joshlf force-pushed the try-from-bytes-raw-argument-to-is-bit-valid-1-known-layout branch from b15e438 to d406386 Compare September 7, 2023 18:35
@joshlf joshlf changed the title [WIP] KnownLayout Add KnownLayout trait Sep 7, 2023
@joshlf joshlf force-pushed the try-from-bytes-raw-argument-to-is-bit-valid-1-known-layout branch 2 times, most recently from 7de1eff to 887a5ae Compare September 7, 2023 19:24
jswrenn
jswrenn previously approved these changes Sep 7, 2023
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
In its initial form, the `KnownLayout` trait encodes type layout
information slightly more complex than can be gleaned from any arbitrary
`T: ?Sized`. This allows it to support not just sized and slice types,
but also "custom DSTs" (those with fixed-size fields followed by a
trailing slice type). This is the first step to supporting various
operations on arbitrary custom DSTs.

Makes progress on #29
@joshlf joshlf force-pushed the try-from-bytes-raw-argument-to-is-bit-valid-1-known-layout branch from 887a5ae to f7c1d7b Compare September 7, 2023 20:19
@joshlf joshlf requested a review from jswrenn September 7, 2023 20:22
@joshlf
Copy link
Member Author

joshlf commented Sep 7, 2023

There's a bit of different logic to handle Layouts now that could use a glance before you approve again.

@joshlf joshlf merged commit e7a36dc into main Sep 7, 2023
150 checks passed
@joshlf joshlf deleted the try-from-bytes-raw-argument-to-is-bit-valid-1-known-layout branch September 7, 2023 20:41
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

Successfully merging this pull request may close these issues.

2 participants