Trait binpool::Scalar [] [src]

pub trait Scalar: Sized + Default {
    fn ty() -> Type;
    fn write<W: Write>(&self, w: &mut W) -> Result<usize>;
    fn read<R: Read>(&mut self, r: &mut R) -> Result<usize>;

    fn write_property<W: Write>(
        &self,
        property_id: u16,
        w: &mut W
    ) -> Result<()> { ... } fn write_array<W: Write, A: Array<Item = Self>>(
        property_id: u16,
        arr: &A,
        w: &mut W
    ) -> Result<()> { ... } fn read_property<R: Read>(
        &mut self,
        state: State<Bytes>,
        ty: u16,
        r: &mut R
    ) -> Result<()> { ... } fn read_array<R: Read, A: Array<Item = Self>>(
        state: State<Bytes>,
        ty: u16,
        arr: &mut A,
        r: &mut R
    ) -> Result<()> { ... } }

Implemented by scalar values.

Required Methods

Type of scalar.

Write to binary.

Read from binary.

Provided Methods

Writes property.

Writes array.

Reads property.

Reads array.

Implementors