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 Types§

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 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 = ()>,

Object Safety§

This trait is not object safe.

Implementors§

source§

impl SeqRepr for LeU32

source§

const MAX_LEN: usize = 4_294_967_295usize

source§

const SIZE: Option<usize> = None

§

type Ctx = ()

source§

impl SeqRepr for LeU64

source§

const MAX_LEN: usize = 18_446_744_073_709_551_615usize

source§

const SIZE: Option<usize> = None

§

type Ctx = ()