Trait bytevec::ByteDecodable [] [src]

pub trait ByteDecodable: Sized {
    fn decode<Size>(bytes: &[u8]) -> BVDecodeResult<Self> where Size: BVSize + ByteDecodable;

    fn decode_max<Size>(bytes: &[u8], limit: Size) -> BVDecodeResult<Self> where Size: BVSize + ByteDecodable { ... }
}

Provides deserialization functionality for the implementing types.

Required Methods

fn decode<Size>(bytes: &[u8]) -> BVDecodeResult<Self> where Size: BVSize + ByteDecodable

Returns an instance of Self obtained from the deserialization of the provided byte buffer.

Provided Methods

fn decode_max<Size>(bytes: &[u8], limit: Size) -> BVDecodeResult<Self> where Size: BVSize + ByteDecodable

Returns the result of decode if bytes.len() is less or equal than limit

Implementors