pub struct ZeroSlice<T, const ALIGN: usize, E: Endian = NativeEndian> { /* private fields */ }Available on (crate features
alloc or std or derive or serde or zero-copy or static-size) and crate feature zero-copy only.Expand description
A zero-copy slice collection conceptually equivalent to &[T] or Vec<T>.
Implementations§
Trait Implementations§
Source§impl<'a, T: ZeroCopy, const ALIGN: usize, E: Endian> Arbitrary<'a> for ZeroSlice<T, ALIGN, E>
Available on crate feature fuzzing only.
impl<'a, T: ZeroCopy, const ALIGN: usize, E: Endian> Arbitrary<'a> for ZeroSlice<T, ALIGN, E>
Available on crate feature
fuzzing only.Source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
Generate an arbitrary value of
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Generate an arbitrary value of
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Get a size hint for how many bytes out of an
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Get a size hint for how many bytes out of an
Unstructured this type
needs to construct itself. Read moreSource§impl<'de, T: StaticSize, const ALIGN: usize, E: Endian, Context> BorrowDecode<'de, Context> for ZeroSlice<T, ALIGN, E>
impl<'de, T: StaticSize, const ALIGN: usize, E: Endian, Context> BorrowDecode<'de, Context> for ZeroSlice<T, ALIGN, E>
Source§fn borrow_decode<D: BorrowDecoder<'de, Context = Context>>(
decoder: &mut D,
) -> Result<Self, DecodeError>
fn borrow_decode<D: BorrowDecoder<'de, Context = Context>>( decoder: &mut D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given [
BorrowDecode]. Read moreSource§impl<T: StaticSize, const ALIGN: usize, E: Endian, Context> Decode<Context> for ZeroSlice<T, ALIGN, E>
impl<T: StaticSize, const ALIGN: usize, E: Endian, Context> Decode<Context> for ZeroSlice<T, ALIGN, E>
Source§impl<T: ZeroCopy + DeepValidator, const ALIGN: usize, E: Endian> DeepValidator for ZeroSlice<T, ALIGN, E>
impl<T: ZeroCopy + DeepValidator, const ALIGN: usize, E: Endian> DeepValidator for ZeroSlice<T, ALIGN, E>
Source§fn is_valid_deep(&self, buffer: &[u8]) -> bool
fn is_valid_deep(&self, buffer: &[u8]) -> bool
Performs a deep validation check on the relative pointer.
Source§impl<T: PartialEq, const ALIGN: usize, E: PartialEq + Endian> PartialEq for ZeroSlice<T, ALIGN, E>
impl<T: PartialEq, const ALIGN: usize, E: PartialEq + Endian> PartialEq for ZeroSlice<T, ALIGN, E>
Source§impl<T, const ALIGN: usize, E: Endian> StaticSize for ZeroSlice<T, ALIGN, E>
impl<T, const ALIGN: usize, E: Endian> StaticSize for ZeroSlice<T, ALIGN, E>
Source§impl<E: Endian, T, const ALIGN: usize> ZeroCopyType<E> for ZeroSlice<T, ALIGN, E>where
T: ZeroCopy + ZeroCopyType<E>,
Available on crate feature alloc only.
impl<E: Endian, T, const ALIGN: usize> ZeroCopyType<E> for ZeroSlice<T, ALIGN, E>where
T: ZeroCopy + ZeroCopyType<E>,
Available on crate feature
alloc only.Source§type Builder = SliceBuilder<<T as ZeroCopyType<E>>::Builder, ALIGN>
type Builder = SliceBuilder<<T as ZeroCopyType<E>>::Builder, ALIGN>
The builder type associated with this trait.
impl<T: Copy, const ALIGN: usize, E: Copy + Endian> Copy for ZeroSlice<T, ALIGN, E>
impl<T: Eq, const ALIGN: usize, E: Eq + Endian> Eq for ZeroSlice<T, ALIGN, E>
impl<T, const ALIGN: usize, E: Endian> StructuralPartialEq for ZeroSlice<T, ALIGN, E>
Auto Trait Implementations§
impl<T, const ALIGN: usize, E> Freeze for ZeroSlice<T, ALIGN, E>
impl<T, const ALIGN: usize, E> RefUnwindSafe for ZeroSlice<T, ALIGN, E>where
T: RefUnwindSafe,
E: RefUnwindSafe,
impl<T, const ALIGN: usize, E> Send for ZeroSlice<T, ALIGN, E>
impl<T, const ALIGN: usize, E> Sync for ZeroSlice<T, ALIGN, E>
impl<T, const ALIGN: usize, E> Unpin for ZeroSlice<T, ALIGN, E>
impl<T, const ALIGN: usize, E> UnsafeUnpin for ZeroSlice<T, ALIGN, E>
impl<T, const ALIGN: usize, E> UnwindSafe for ZeroSlice<T, ALIGN, E>where
T: UnwindSafe,
E: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more