Skip to main content

SeqRepr

Trait SeqRepr 

Source
pub trait SeqRepr {
    type Ctx;

    const MAX_LEN: usize;
    const SIZE: Option<usize>;

    // Required methods
    fn serialize<T: MySerialize>(seq: &[T], buf: &mut Vec<u8>);
    fn deserialize<'de, T>(
        ctx: Self::Ctx,
        buf: &mut ParseBuf<'de>,
    ) -> Result<Cow<'de, [T]>>
       where T: Clone + MyDeserialize<'de, Ctx = ()>;
}
Expand description

Representation of a serialized bytes.

Required Associated Constants§

Source

const MAX_LEN: usize

Maximum number of items in a sequence (depends on how lenght is stored).

Source

const SIZE: Option<usize>

Required Associated Types§

Required Methods§

Source

fn serialize<T: MySerialize>(seq: &[T], buf: &mut Vec<u8>)

Source

fn deserialize<'de, T>( ctx: Self::Ctx, buf: &mut ParseBuf<'de>, ) -> Result<Cow<'de, [T]>>
where T: Clone + MyDeserialize<'de, Ctx = ()>,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl SeqRepr for LeU32

Source§

impl SeqRepr for LeU64

Source§

impl SeqRepr for Unknown

Unknown number of elements.

Source§

const MAX_LEN: usize = usize::MAX

Source§

const SIZE: Option<usize> = None

Source§

type Ctx = usize