You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A type with the same layout as T (including alignment) but fewer bit validity requirements. Bytes must be initialized if required by T, but they may be uninitialized if permitted by T. This is exactly equivalent to the semantics of the AsInitializedPtr invariant:
Yes, essentially it acts as a deferred TryFromBytes. It also makes any external type FromBytes like MaybeUninit can, but conversion to the inner type remains unsafe.
MaybeValid<T>: FromBytes
MaybeValid<T>: IntoBytes where T: IntoBytes
MaybeValid<T>: DerefMut<Target = T> where T: FromBytes
T: TryFrom<MaybeValid<T>> where T: TryFromBytes
&T: TryFrom<MaybeValid<&T>> where T: TryFromBytes
&mut T: TryFrom<MaybeValid<&mut T>> where T: TryFromBytes
T: From<MaybeValid<T>> where T: FromBytes
&T: From<MaybeValid<&T>> where T: FromBytes
&mut T: From<MaybeValid<&mut T>> where T: FromBytes
Most of these conversions are unsafe on MaybeUninit.
Needed by #497
Could be supported by #1797
A type with the same layout as
T
(including alignment) but fewer bit validity requirements. Bytes must be initialized if required byT
, but they may be uninitialized if permitted byT
. This is exactly equivalent to the semantics of theAsInitialized
Ptr
invariant:zerocopy/src/pointer/ptr.rs
Lines 260 to 291 in 06fd1b2
cc @kupiakos
The text was updated successfully, but these errors were encountered: