Replies: 2 comments 1 reply
-
|
Outside of a const context, we'd recommend In const, it's trickier. If you're willing to rely on zerocopy's internals, which provide no stability guarantees, you can look at the associated Alternatively, you could just re-implement machinery like this, although it's pretty involved. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
an alternative solution would be to create a zeroed value of the struct (with the variable length portion set to size 0) in a const context. I didn't see a way to do it, would that possible eventually? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Suppose i did:
How can I get the length of the fixed size portion of
Sprogramatically? I thought maybe I could create anAccessRulewith length zero and then usecore::mem::size_of_val()for the dst, but I don't see a way to do that in a const context.Beta Was this translation helpful? Give feedback.
All reactions