Trait FromBytesWithInput

Source
pub trait FromBytesWithInput<'a>: Sized + Debug {
    type Input: Debug;

    // Required method
    fn from_bytes_with_input(
        buffer: &mut Cursor<&'a [u8]>,
        input: Self::Input,
    ) -> Result<Self, DeError>;
}
Expand description

Takes an arbitrary input which serves as additional information for guiding the conversion from a byte buffer to a data structure. A common workflow is a data structure that has a size to determine how much more of the data in the byte buffer is part of a given data structure.

Required Associated Types§

Source

type Input: Debug

The type of the additional input.

Required Methods§

Source

fn from_bytes_with_input( buffer: &mut Cursor<&'a [u8]>, input: Self::Input, ) -> Result<Self, DeError>

Takes a byte buffer and an additional input and returns the deserialized data structure.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a> FromBytesWithInput<'a> for &'a str

Source§

type Input = usize

Source§

fn from_bytes_with_input( buffer: &mut Cursor<&'a [u8]>, input: usize, ) -> Result<Self, DeError>

Source§

impl<'a> FromBytesWithInput<'a> for &'a [u8]

Source§

type Input = usize

Source§

fn from_bytes_with_input( buffer: &mut Cursor<&'a [u8]>, input: usize, ) -> Result<Self, DeError>

Source§

impl<'a> FromBytesWithInput<'a> for String

Source§

type Input = usize

Source§

fn from_bytes_with_input( buffer: &mut Cursor<&'a [u8]>, input: usize, ) -> Result<Self, DeError>

Source§

impl<'lt> FromBytesWithInput<'lt> for ()

Source§

type Input = usize

Source§

fn from_bytes_with_input( _: &mut Cursor<&'lt [u8]>, input: usize, ) -> Result<Self, DeError>

Source§

impl<'lt, T> FromBytesWithInput<'lt> for Vec<T>
where T: FromBytes<'lt>,

Source§

type Input = usize

Source§

fn from_bytes_with_input( buffer: &mut Cursor<&'lt [u8]>, input: Self::Input, ) -> Result<Self, DeError>

Implementors§

Source§

impl<'a, T, P> FromBytesWithInput<'a> for NlPayload<T, P>
where P: FromBytesWithInput<'a, Input = usize>, T: NlType,

Source§

type Input = (usize, T)

Source§

impl<'lifetime> FromBytesWithInput<'lifetime> for Ifaddrmsg

Source§

impl<'lifetime> FromBytesWithInput<'lifetime> for Ifinfomsg

Source§

impl<'lifetime> FromBytesWithInput<'lifetime> for Ndmsg

Source§

impl<'lifetime> FromBytesWithInput<'lifetime> for Rtmsg

Source§

impl<'lifetime> FromBytesWithInput<'lifetime> for Tcmsg

Source§

impl<'lifetime> FromBytesWithInput<'lifetime> for Buffer

Source§

impl<'lifetime, C: Cmd + TypeSize, T: NlAttrType, H: TypeSize + FromBytes<'lifetime>> FromBytesWithInput<'lifetime> for Genlmsghdr<C, T, H>

Source§

impl<'lifetime, T: NlAttrType, P: FromBytesWithInput<'lifetime, Input = usize>> FromBytesWithInput<'lifetime> for GenlBuffer<T, P>

Source§

impl<'lifetime, T: NlType, P: FromBytesWithInput<'lifetime, Input = usize>> FromBytesWithInput<'lifetime> for Nlmsgerr<T, P>

Source§

impl<'lifetime, T: NlType, P: FromBytesWithInput<'lifetime, Input = usize>> FromBytesWithInput<'lifetime> for NlBuffer<T, P>

Source§

impl<'lifetime, T: RtaType, P: FromBytesWithInput<'lifetime, Input = usize>> FromBytesWithInput<'lifetime> for RtBuffer<T, P>

Source§

impl<'lifetime, T: TypeSize + FromBytes<'lifetime>, P: FromBytesWithInput<'lifetime, Input = usize>> FromBytesWithInput<'lifetime> for NlmsghdrErr<T, P>