[][src]Trait ordcode::params::LengthEncoder

pub trait LengthEncoder {
    type Value;
    pub fn calc_size(value: Self::Value) -> usize;
pub fn read(reader: impl TailReadBytes) -> Result<Self::Value>;
pub fn write(writer: impl TailWriteBytes, value: Self::Value) -> Result; }

Encoder for array lengths, enum discriminants etc.

Associated Types

type Value[src]

Value type, may be u32, u64 or usize

Loading content...

Required methods

pub fn calc_size(value: Self::Value) -> usize[src]

Calculate serialized size for value

pub fn read(reader: impl TailReadBytes) -> Result<Self::Value>[src]

pub fn write(writer: impl TailWriteBytes, value: Self::Value) -> Result[src]

Loading content...

Implementors

impl LengthEncoder for VarIntDiscrEncoder[src]

type Value = u32

impl LengthEncoder for VarIntLenEncoder[src]

type Value = usize

impl LengthEncoder for VarIntTailLenEncoder[src]

type Value = usize

Loading content...