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
fn ty() -> Type
Type of scalar.
fn write<W: Write>(&self, w: &mut W) -> Result<usize>
Write to binary.
fn read<R: Read>(&mut self, r: &mut R) -> Result<usize>
Read from binary.
Provided Methods
fn write_property<W: Write>(&self, property_id: u16, w: &mut W) -> Result<()>
Writes property.
fn write_array<W: Write, A: Array<Item = Self>>(
property_id: u16,
arr: &A,
w: &mut W
) -> Result<()>
property_id: u16,
arr: &A,
w: &mut W
) -> Result<()>
Writes array.
fn read_property<R: Read>(
&mut self,
state: State<Bytes>,
ty: u16,
r: &mut R
) -> Result<()>
&mut self,
state: State<Bytes>,
ty: u16,
r: &mut R
) -> Result<()>
Reads property.
fn read_array<R: Read, A: Array<Item = Self>>(
state: State<Bytes>,
ty: u16,
arr: &mut A,
r: &mut R
) -> Result<()>
state: State<Bytes>,
ty: u16,
arr: &mut A,
r: &mut R
) -> Result<()>
Reads array.