pub trait Decode<'a>: Sized {
    type Output: Debug;
    type Error: Debug;

    fn decode(buff: &'a [u8]) -> Result<(Self::Output, usize), Self::Error>;

    fn decode_iter(buff: &'a [u8]) -> DecodeIter<'a, Self::Output, Self::Error>Notable traits for DecodeIter<'a, T, E>impl<'a, T, E> Iterator for DecodeIter<'a, T, E>where
    T: Decode<'a, Output = T, Error = E>,
type Item = Result<T, E>;
{ ... } }
Expand description

Decode trait implemented for binary decodable objects

Required Associated Types

Output type (required for lifetime bounds)

Error type returned on parse error

Required Methods

Decode consumes a slice and returns an object and decoded length

Provided Methods

Helper to iterate over decodable objects in a sized buffer

Implementations on Foreign Types

Blanket Decode impl for slices of encodable types

Implementors