Trait zerocopy_helpers::FromBytesExt

source ·
pub trait FromBytesExt: FromBytes {
    // Provided methods
    fn read_from_prefix_split(bytes: &[u8]) -> Option<(Self, &[u8])>
       where Self: Sized { ... }
    fn read_from_suffix_split(bytes: &[u8]) -> Option<(&[u8], Self)>
       where Self: Sized { ... }
}

Provided Methods§

source

fn read_from_prefix_split(bytes: &[u8]) -> Option<(Self, &[u8])>
where Self: Sized,

Reads a copy of Self from the prefix of bytes. Returns both the copy of Self and the remaining unused bytes.

source

fn read_from_suffix_split(bytes: &[u8]) -> Option<(&[u8], Self)>
where Self: Sized,

Reads a copy of Self from the suffix of bytes. Returns both the remaining unused bytes and the copy of Self.

Implementors§

source§

impl<T: FromBytes> FromBytesExt for T