Struct s2n_codec::zerocopy::LayoutVerified
source · pub struct LayoutVerified<B, T>(_, _)
where
T: ?Sized;Expand description
A length- and alignment-checked reference to a byte slice which can safely be reinterpreted as another type.
LayoutVerified is a byte slice reference (&[u8], &mut [u8],
Ref<[u8]>, RefMut<[u8]>, etc) with the invaraint that the slice’s length
and alignment are each greater than or equal to the length and alignment of
T. Using this invariant, it implements Deref for T so long as T: FromBytes and DerefMut so long as T: FromBytes + AsBytes.
Examples
LayoutVerified can be used to treat a sequence of bytes as a structured
type, and to read and write the fields of that type as if the byte slice
reference were simply a reference to that type.
use zerocopy::{AsBytes, ByteSlice, ByteSliceMut, FromBytes, LayoutVerified, Unaligned};
#[derive(FromBytes, AsBytes, Unaligned)]
#[repr(C)]
struct UdpHeader {
src_port: [u8; 2],
dst_port: [u8; 2],
length: [u8; 2],
checksum: [u8; 2],
}
struct UdpPacket<B> {
header: LayoutVerified<B, UdpHeader>,
body: B,
}
impl<B: ByteSlice> UdpPacket<B> {
pub fn parse(bytes: B) -> Option<UdpPacket<B>> {
let (header, body) = LayoutVerified::new_unaligned_from_prefix(bytes)?;
Some(UdpPacket { header, body })
}
pub fn get_src_port(&self) -> [u8; 2] {
self.header.src_port
}
}
impl<B: ByteSliceMut> UdpPacket<B> {
pub fn set_src_port(&mut self, src_port: [u8; 2]) {
self.header.src_port = src_port;
}
}Implementations§
source§impl<B, T> LayoutVerified<B, T>where
B: ByteSlice,
impl<B, T> LayoutVerified<B, T>where B: ByteSlice,
sourcepub fn new(bytes: B) -> Option<LayoutVerified<B, T>>
pub fn new(bytes: B) -> Option<LayoutVerified<B, T>>
Constructs a new LayoutVerified.
new verifies that bytes.len() == size_of::<T>() and that bytes is
aligned to align_of::<T>(), and constructs a new LayoutVerified. If
either of these checks fail, it returns None.
sourcepub fn new_from_prefix(bytes: B) -> Option<(LayoutVerified<B, T>, B)>
pub fn new_from_prefix(bytes: B) -> Option<(LayoutVerified<B, T>, B)>
Constructs a new LayoutVerified from the prefix of a byte slice.
new_from_prefix verifies that bytes.len() >= size_of::<T>() and that
bytes is aligned to align_of::<T>(). It consumes the first
size_of::<T>() bytes from bytes to construct a LayoutVerified, and
returns the remaining bytes to the caller. If either the length or
alignment checks fail, it returns None.
sourcepub fn new_from_suffix(bytes: B) -> Option<(B, LayoutVerified<B, T>)>
pub fn new_from_suffix(bytes: B) -> Option<(B, LayoutVerified<B, T>)>
Constructs a new LayoutVerified from the suffix of a byte slice.
new_from_suffix verifies that bytes.len() >= size_of::<T>() and that
the last size_of::<T>() bytes of bytes are aligned to
align_of::<T>(). It consumes the last size_of::<T>() bytes from
bytes to construct a LayoutVerified, and returns the preceding bytes
to the caller. If either the length or alignment checks fail, it returns
None.
source§impl<B, T> LayoutVerified<B, [T]>where
B: ByteSlice,
impl<B, T> LayoutVerified<B, [T]>where B: ByteSlice,
sourcepub fn new_slice(bytes: B) -> Option<LayoutVerified<B, [T]>>
pub fn new_slice(bytes: B) -> Option<LayoutVerified<B, [T]>>
Constructs a new LayoutVerified of a slice type.
new_slice verifies that bytes.len() is a multiple of
size_of::<T>() and that bytes is aligned to align_of::<T>(), and
constructs a new LayoutVerified. If either of these checks fail, it
returns None.
Panics
new_slice panics if T is a zero-sized type.
sourcepub fn new_slice_from_prefix(
bytes: B,
count: usize
) -> Option<(LayoutVerified<B, [T]>, B)>
pub fn new_slice_from_prefix( bytes: B, count: usize ) -> Option<(LayoutVerified<B, [T]>, B)>
Constructs a new LayoutVerified of a slice type from the prefix of a
byte slice.
new_slice_from_prefix verifies that bytes.len() >= size_of::<T>() * count and that bytes is aligned to align_of::<T>(). It consumes the
first size_of::<T>() * count bytes from bytes to construct a
LayoutVerified, and returns the remaining bytes to the caller. It also
ensures that sizeof::<T>() * count does not overflow a usize. If any
of the length, alignment, or overflow checks fail, it returns None.
Panics
new_slice_from_prefix panics if T is a zero-sized type.
sourcepub fn new_slice_from_suffix(
bytes: B,
count: usize
) -> Option<(B, LayoutVerified<B, [T]>)>
pub fn new_slice_from_suffix( bytes: B, count: usize ) -> Option<(B, LayoutVerified<B, [T]>)>
Constructs a new LayoutVerified of a slice type from the suffix of a
byte slice.
new_slice_from_suffix verifies that bytes.len() >= size_of::<T>() * count and that bytes is aligned to align_of::<T>(). It consumes the
last size_of::<T>() * count bytes from bytes to construct a
LayoutVerified, and returns the preceding bytes to the caller. It also
ensures that sizeof::<T>() * count does not overflow a usize. If any
of the length, alignment, or overflow checks fail, it returns None.
Panics
new_slice_from_suffix panics if T is a zero-sized type.
source§impl<B, T> LayoutVerified<B, T>where
B: ByteSliceMut,
impl<B, T> LayoutVerified<B, T>where B: ByteSliceMut,
sourcepub fn new_zeroed(bytes: B) -> Option<LayoutVerified<B, T>>
pub fn new_zeroed(bytes: B) -> Option<LayoutVerified<B, T>>
Constructs a new LayoutVerified after zeroing the bytes.
new_zeroed verifies that bytes.len() == size_of::<T>() and that
bytes is aligned to align_of::<T>(), and constructs a new
LayoutVerified. If either of these checks fail, it returns None.
If the checks succeed, then bytes will be initialized to zero. This
can be useful when re-using buffers to ensure that sensitive data
previously stored in the buffer is not leaked.
sourcepub fn new_from_prefix_zeroed(bytes: B) -> Option<(LayoutVerified<B, T>, B)>
pub fn new_from_prefix_zeroed(bytes: B) -> Option<(LayoutVerified<B, T>, B)>
Constructs a new LayoutVerified from the prefix of a byte slice,
zeroing the prefix.
new_from_prefix_zeroed verifies that bytes.len() >= size_of::<T>()
and that bytes is aligned to align_of::<T>(). It consumes the first
size_of::<T>() bytes from bytes to construct a LayoutVerified, and
returns the remaining bytes to the caller. If either the length or
alignment checks fail, it returns None.
If the checks succeed, then the prefix which is consumed will be initialized to zero. This can be useful when re-using buffers to ensure that sensitive data previously stored in the buffer is not leaked.
sourcepub fn new_from_suffix_zeroed(bytes: B) -> Option<(B, LayoutVerified<B, T>)>
pub fn new_from_suffix_zeroed(bytes: B) -> Option<(B, LayoutVerified<B, T>)>
Constructs a new LayoutVerified from the suffix of a byte slice,
zeroing the suffix.
new_from_suffix_zeroed verifies that bytes.len() >= size_of::<T>()
and that the last size_of::<T>() bytes of bytes are aligned to
align_of::<T>(). It consumes the last size_of::<T>() bytes from
bytes to construct a LayoutVerified, and returns the preceding bytes
to the caller. If either the length or alignment checks fail, it returns
None.
If the checks succeed, then the suffix which is consumed will be initialized to zero. This can be useful when re-using buffers to ensure that sensitive data previously stored in the buffer is not leaked.
source§impl<B, T> LayoutVerified<B, [T]>where
B: ByteSliceMut,
impl<B, T> LayoutVerified<B, [T]>where B: ByteSliceMut,
sourcepub fn new_slice_zeroed(bytes: B) -> Option<LayoutVerified<B, [T]>>
pub fn new_slice_zeroed(bytes: B) -> Option<LayoutVerified<B, [T]>>
Constructs a new LayoutVerified of a slice type after zeroing the
bytes.
new_slice_zeroed verifies that bytes.len() is a multiple of
size_of::<T>() and that bytes is aligned to align_of::<T>(), and
constructs a new LayoutVerified. If either of these checks fail, it
returns None.
If the checks succeed, then bytes will be initialized to zero. This
can be useful when re-using buffers to ensure that sensitive data
previously stored in the buffer is not leaked.
Panics
new_slice panics if T is a zero-sized type.
sourcepub fn new_slice_from_prefix_zeroed(
bytes: B,
count: usize
) -> Option<(LayoutVerified<B, [T]>, B)>
pub fn new_slice_from_prefix_zeroed( bytes: B, count: usize ) -> Option<(LayoutVerified<B, [T]>, B)>
Constructs a new LayoutVerified of a slice type from the prefix of a
byte slice, after zeroing the bytes.
new_slice_from_prefix verifies that bytes.len() >= size_of::<T>() * count and that bytes is aligned to align_of::<T>(). It consumes the
first size_of::<T>() * count bytes from bytes to construct a
LayoutVerified, and returns the remaining bytes to the caller. It also
ensures that sizeof::<T>() * count does not overflow a usize. If any
of the length, alignment, or overflow checks fail, it returns None.
If the checks succeed, then the suffix which is consumed will be initialized to zero. This can be useful when re-using buffers to ensure that sensitive data previously stored in the buffer is not leaked.
Panics
new_slice_from_prefix_zeroed panics if T is a zero-sized type.
sourcepub fn new_slice_from_suffix_zeroed(
bytes: B,
count: usize
) -> Option<(B, LayoutVerified<B, [T]>)>
pub fn new_slice_from_suffix_zeroed( bytes: B, count: usize ) -> Option<(B, LayoutVerified<B, [T]>)>
Constructs a new LayoutVerified of a slice type from the prefix of a
byte slice, after zeroing the bytes.
new_slice_from_suffix verifies that bytes.len() >= size_of::<T>() * count and that bytes is aligned to align_of::<T>(). It consumes the
last size_of::<T>() * count bytes from bytes to construct a
LayoutVerified, and returns the preceding bytes to the caller. It also
ensures that sizeof::<T>() * count does not overflow a usize. If any
of the length, alignment, or overflow checks fail, it returns None.
If the checks succeed, then the consumed suffix will be initialized to zero. This can be useful when re-using buffers to ensure that sensitive data previously stored in the buffer is not leaked.
Panics
new_slice_from_suffix_zeroed panics if T is a zero-sized type.
source§impl<B, T> LayoutVerified<B, T>where
B: ByteSlice,
T: Unaligned,
impl<B, T> LayoutVerified<B, T>where B: ByteSlice, T: Unaligned,
sourcepub fn new_unaligned(bytes: B) -> Option<LayoutVerified<B, T>>
pub fn new_unaligned(bytes: B) -> Option<LayoutVerified<B, T>>
Constructs a new LayoutVerified for a type with no alignment
requirement.
new_unaligned verifies that bytes.len() == size_of::<T>() and
constructs a new LayoutVerified. If the check fails, it returns
None.
sourcepub fn new_unaligned_from_prefix(bytes: B) -> Option<(LayoutVerified<B, T>, B)>
pub fn new_unaligned_from_prefix(bytes: B) -> Option<(LayoutVerified<B, T>, B)>
Constructs a new LayoutVerified from the prefix of a byte slice for a
type with no alignment requirement.
new_unaligned_from_prefix verifies that bytes.len() >= size_of::<T>(). It consumes the first size_of::<T>() bytes from
bytes to construct a LayoutVerified, and returns the remaining bytes
to the caller. If the length check fails, it returns None.
sourcepub fn new_unaligned_from_suffix(bytes: B) -> Option<(B, LayoutVerified<B, T>)>
pub fn new_unaligned_from_suffix(bytes: B) -> Option<(B, LayoutVerified<B, T>)>
Constructs a new LayoutVerified from the suffix of a byte slice for a
type with no alignment requirement.
new_unaligned_from_suffix verifies that bytes.len() >= size_of::<T>(). It consumes the last size_of::<T>() bytes from
bytes to construct a LayoutVerified, and returns the preceding bytes
to the caller. If the length check fails, it returns None.
source§impl<B, T> LayoutVerified<B, [T]>where
B: ByteSlice,
T: Unaligned,
impl<B, T> LayoutVerified<B, [T]>where B: ByteSlice, T: Unaligned,
sourcepub fn new_slice_unaligned(bytes: B) -> Option<LayoutVerified<B, [T]>>
pub fn new_slice_unaligned(bytes: B) -> Option<LayoutVerified<B, [T]>>
Constructs a new LayoutVerified of a slice type with no alignment
requirement.
new_slice_unaligned verifies that bytes.len() is a multiple of
size_of::<T>() and constructs a new LayoutVerified. If the check
fails, it returns None.
Panics
new_slice panics if T is a zero-sized type.
sourcepub fn new_slice_unaligned_from_prefix(
bytes: B,
count: usize
) -> Option<(LayoutVerified<B, [T]>, B)>
pub fn new_slice_unaligned_from_prefix( bytes: B, count: usize ) -> Option<(LayoutVerified<B, [T]>, B)>
Constructs a new LayoutVerified of a slice type with no alignment
requirement from the prefix of a byte slice.
new_slice_from_prefix verifies that bytes.len() >= size_of::<T>() * count. It consumes the first size_of::<T>() * count bytes from
bytes to construct a LayoutVerified, and returns the remaining bytes
to the caller. It also ensures that sizeof::<T>() * count does not
overflow a usize. If either the length, or overflow checks fail, it
returns None.
Panics
new_slice_unaligned_from_prefix panics if T is a zero-sized type.
sourcepub fn new_slice_unaligned_from_suffix(
bytes: B,
count: usize
) -> Option<(B, LayoutVerified<B, [T]>)>
pub fn new_slice_unaligned_from_suffix( bytes: B, count: usize ) -> Option<(B, LayoutVerified<B, [T]>)>
Constructs a new LayoutVerified of a slice type with no alignment
requirement from the suffix of a byte slice.
new_slice_from_suffix verifies that bytes.len() >= size_of::<T>() * count. It consumes the last size_of::<T>() * count bytes from bytes
to construct a LayoutVerified, and returns the remaining bytes to the
caller. It also ensures that sizeof::<T>() * count does not overflow a
usize. If either the length, or overflow checks fail, it returns
None.
Panics
new_slice_unaligned_from_suffix panics if T is a zero-sized type.
source§impl<B, T> LayoutVerified<B, T>where
B: ByteSliceMut,
T: Unaligned,
impl<B, T> LayoutVerified<B, T>where B: ByteSliceMut, T: Unaligned,
sourcepub fn new_unaligned_zeroed(bytes: B) -> Option<LayoutVerified<B, T>>
pub fn new_unaligned_zeroed(bytes: B) -> Option<LayoutVerified<B, T>>
Constructs a new LayoutVerified for a type with no alignment
requirement, zeroing the bytes.
new_unaligned_zeroed verifies that bytes.len() == size_of::<T>() and
constructs a new LayoutVerified. If the check fails, it returns
None.
If the check succeeds, then bytes will be initialized to zero. This
can be useful when re-using buffers to ensure that sensitive data
previously stored in the buffer is not leaked.
sourcepub fn new_unaligned_from_prefix_zeroed(
bytes: B
) -> Option<(LayoutVerified<B, T>, B)>
pub fn new_unaligned_from_prefix_zeroed( bytes: B ) -> Option<(LayoutVerified<B, T>, B)>
Constructs a new LayoutVerified from the prefix of a byte slice for a
type with no alignment requirement, zeroing the prefix.
new_unaligned_from_prefix_zeroed verifies that bytes.len() >= size_of::<T>(). It consumes the first size_of::<T>() bytes from
bytes to construct a LayoutVerified, and returns the remaining bytes
to the caller. If the length check fails, it returns None.
If the check succeeds, then the prefix which is consumed will be initialized to zero. This can be useful when re-using buffers to ensure that sensitive data previously stored in the buffer is not leaked.
sourcepub fn new_unaligned_from_suffix_zeroed(
bytes: B
) -> Option<(B, LayoutVerified<B, T>)>
pub fn new_unaligned_from_suffix_zeroed( bytes: B ) -> Option<(B, LayoutVerified<B, T>)>
Constructs a new LayoutVerified from the suffix of a byte slice for a
type with no alignment requirement, zeroing the suffix.
new_unaligned_from_suffix_zeroed verifies that bytes.len() >= size_of::<T>(). It consumes the last size_of::<T>() bytes from
bytes to construct a LayoutVerified, and returns the preceding bytes
to the caller. If the length check fails, it returns None.
If the check succeeds, then the suffix which is consumed will be initialized to zero. This can be useful when re-using buffers to ensure that sensitive data previously stored in the buffer is not leaked.
source§impl<B, T> LayoutVerified<B, [T]>where
B: ByteSliceMut,
T: Unaligned,
impl<B, T> LayoutVerified<B, [T]>where B: ByteSliceMut, T: Unaligned,
sourcepub fn new_slice_unaligned_zeroed(bytes: B) -> Option<LayoutVerified<B, [T]>>
pub fn new_slice_unaligned_zeroed(bytes: B) -> Option<LayoutVerified<B, [T]>>
Constructs a new LayoutVerified for a slice type with no alignment
requirement, zeroing the bytes.
new_slice_unaligned_zeroed verifies that bytes.len() is a multiple
of size_of::<T>() and constructs a new LayoutVerified. If the check
fails, it returns None.
If the check succeeds, then bytes will be initialized to zero. This
can be useful when re-using buffers to ensure that sensitive data
previously stored in the buffer is not leaked.
Panics
new_slice panics if T is a zero-sized type.
sourcepub fn new_slice_unaligned_from_prefix_zeroed(
bytes: B,
count: usize
) -> Option<(LayoutVerified<B, [T]>, B)>
pub fn new_slice_unaligned_from_prefix_zeroed( bytes: B, count: usize ) -> Option<(LayoutVerified<B, [T]>, B)>
Constructs a new LayoutVerified of a slice type with no alignment
requirement from the prefix of a byte slice, after zeroing the bytes.
new_slice_from_prefix verifies that bytes.len() >= size_of::<T>() * count. It consumes the first size_of::<T>() * count bytes from
bytes to construct a LayoutVerified, and returns the remaining bytes
to the caller. It also ensures that sizeof::<T>() * count does not
overflow a usize. If either the length, or overflow checks fail, it
returns None.
If the checks succeed, then the prefix will be initialized to zero. This can be useful when re-using buffers to ensure that sensitive data previously stored in the buffer is not leaked.
Panics
new_slice_unaligned_from_prefix_zeroed panics if T is a zero-sized
type.
sourcepub fn new_slice_unaligned_from_suffix_zeroed(
bytes: B,
count: usize
) -> Option<(B, LayoutVerified<B, [T]>)>
pub fn new_slice_unaligned_from_suffix_zeroed( bytes: B, count: usize ) -> Option<(B, LayoutVerified<B, [T]>)>
Constructs a new LayoutVerified of a slice type with no alignment
requirement from the suffix of a byte slice, after zeroing the bytes.
new_slice_from_suffix verifies that bytes.len() >= size_of::<T>() * count. It consumes the last size_of::<T>() * count bytes from bytes
to construct a LayoutVerified, and returns the remaining bytes to the
caller. It also ensures that sizeof::<T>() * count does not overflow a
usize. If either the length, or overflow checks fail, it returns
None.
If the checks succeed, then the suffix will be initialized to zero. This can be useful when re-using buffers to ensure that sensitive data previously stored in the buffer is not leaked.
Panics
new_slice_unaligned_from_suffix_zeroed panics if T is a zero-sized
type.
source§impl<'a, B, T> LayoutVerified<B, T>where
B: 'a + ByteSlice,
T: FromBytes,
impl<'a, B, T> LayoutVerified<B, T>where B: 'a + ByteSlice, T: FromBytes,
source§impl<'a, B, T> LayoutVerified<B, T>where
B: 'a + ByteSliceMut,
T: FromBytes + AsBytes,
impl<'a, B, T> LayoutVerified<B, T>where B: 'a + ByteSliceMut, T: FromBytes + AsBytes,
source§impl<'a, B, T> LayoutVerified<B, [T]>where
B: 'a + ByteSlice,
T: FromBytes,
impl<'a, B, T> LayoutVerified<B, [T]>where B: 'a + ByteSlice, T: FromBytes,
sourcepub fn into_slice(self) -> &'a [T] ⓘ
pub fn into_slice(self) -> &'a [T] ⓘ
Converts this LayoutVerified into a slice reference.
into_slice consumes the LayoutVerified, and returns a reference to
[T].
source§impl<'a, B, T> LayoutVerified<B, [T]>where
B: 'a + ByteSliceMut,
T: FromBytes + AsBytes,
impl<'a, B, T> LayoutVerified<B, [T]>where B: 'a + ByteSliceMut, T: FromBytes + AsBytes,
sourcepub fn into_mut_slice(self) -> &'a mut [T] ⓘ
pub fn into_mut_slice(self) -> &'a mut [T] ⓘ
Converts this LayoutVerified into a mutable slice reference.
into_mut_slice consumes the LayoutVerified, and returns a mutable
reference to [T].
source§impl<B, T> LayoutVerified<B, T>where
B: ByteSlice,
T: ?Sized,
impl<B, T> LayoutVerified<B, T>where B: ByteSlice, T: ?Sized,
source§impl<B, T> LayoutVerified<B, T>where
B: ByteSliceMut,
T: ?Sized,
impl<B, T> LayoutVerified<B, T>where B: ByteSliceMut, T: ?Sized,
source§impl<B, T> LayoutVerified<B, T>where
B: ByteSlice,
T: FromBytes,
impl<B, T> LayoutVerified<B, T>where B: ByteSlice, T: FromBytes,
source§impl<B, T> LayoutVerified<B, T>where
B: ByteSliceMut,
T: AsBytes,
impl<B, T> LayoutVerified<B, T>where B: ByteSliceMut, T: AsBytes,
Trait Implementations§
source§impl<B, T> DerefMut for LayoutVerified<B, [T]>where
B: ByteSliceMut,
T: FromBytes + AsBytes,
impl<B, T> DerefMut for LayoutVerified<B, [T]>where B: ByteSliceMut, T: FromBytes + AsBytes,
source§impl<B, T> DerefMut for LayoutVerified<B, T>where
B: ByteSliceMut,
T: FromBytes + AsBytes,
impl<B, T> DerefMut for LayoutVerified<B, T>where B: ByteSliceMut, T: FromBytes + AsBytes,
source§impl<T, B> Ord for LayoutVerified<B, [T]>where
B: ByteSlice,
T: FromBytes + Ord,
impl<T, B> Ord for LayoutVerified<B, [T]>where B: ByteSlice, T: FromBytes + Ord,
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl<T, B> Ord for LayoutVerified<B, T>where
B: ByteSlice,
T: FromBytes + Ord,
impl<T, B> Ord for LayoutVerified<B, T>where B: ByteSlice, T: FromBytes + Ord,
source§fn cmp(&self, other: &LayoutVerified<B, T>) -> Ordering
fn cmp(&self, other: &LayoutVerified<B, T>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl<T, B> PartialEq<LayoutVerified<B, [T]>> for LayoutVerified<B, [T]>where
B: ByteSlice,
T: FromBytes + PartialEq<T>,
impl<T, B> PartialEq<LayoutVerified<B, [T]>> for LayoutVerified<B, [T]>where B: ByteSlice, T: FromBytes + PartialEq<T>,
source§impl<T, B> PartialEq<LayoutVerified<B, T>> for LayoutVerified<B, T>where
B: ByteSlice,
T: FromBytes + PartialEq<T>,
impl<T, B> PartialEq<LayoutVerified<B, T>> for LayoutVerified<B, T>where B: ByteSlice, T: FromBytes + PartialEq<T>,
source§fn eq(&self, other: &LayoutVerified<B, T>) -> bool
fn eq(&self, other: &LayoutVerified<B, T>) -> bool
self and other values to be equal, and is used
by ==.source§impl<T, B> PartialOrd<LayoutVerified<B, [T]>> for LayoutVerified<B, [T]>where
B: ByteSlice,
T: FromBytes + PartialOrd<T>,
impl<T, B> PartialOrd<LayoutVerified<B, [T]>> for LayoutVerified<B, [T]>where B: ByteSlice, T: FromBytes + PartialOrd<T>,
source§fn partial_cmp(&self, other: &LayoutVerified<B, [T]>) -> Option<Ordering>
fn partial_cmp(&self, other: &LayoutVerified<B, [T]>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresource§impl<T, B> PartialOrd<LayoutVerified<B, T>> for LayoutVerified<B, T>where
B: ByteSlice,
T: FromBytes + PartialOrd<T>,
impl<T, B> PartialOrd<LayoutVerified<B, T>> for LayoutVerified<B, T>where B: ByteSlice, T: FromBytes + PartialOrd<T>,
source§fn partial_cmp(&self, other: &LayoutVerified<B, T>) -> Option<Ordering>
fn partial_cmp(&self, other: &LayoutVerified<B, T>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read more