pub trait IntRepr {
    type Primitive: Debug + Default + Copy + Eq + Ord + Hash;

    const SIZE: Option<usize>;

    // Required methods
    fn serialize(val: Self::Primitive, buf: &mut Vec<u8>);
    fn deserialize(buf: &mut ParseBuf<'_>) -> Result<Self::Primitive>;
}
Expand description

Serialized representation of an integer.

Required Associated Types§

Required Associated Constants§

Required Methods§

source

fn serialize(val: Self::Primitive, buf: &mut Vec<u8>)

source

fn deserialize(buf: &mut ParseBuf<'_>) -> Result<Self::Primitive>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl IntRepr for i8

source§

const SIZE: Option<usize> = _

§

type Primitive = i8

source§

fn serialize(val: Self::Primitive, buf: &mut Vec<u8>)

source§

fn deserialize(buf: &mut ParseBuf<'_>) -> Result<Self::Primitive>

source§

impl IntRepr for u8

source§

const SIZE: Option<usize> = _

§

type Primitive = u8

source§

fn serialize(val: Self::Primitive, buf: &mut Vec<u8>)

source§

fn deserialize(buf: &mut ParseBuf<'_>) -> Result<Self::Primitive>

Implementors§