Struct binpool::State
[−]
[src]
pub struct State<T = TypeFormat>(_);
Stores the state for writing and reading.
Methods
impl State
[src]
fn new() -> State
Creates a new state.
fn read<R: Read>(r: &mut R) -> Result<(Option<State<Bytes>>, u16, u16)>
Reads type format and property.
Returns None
in first argument if there is no more data.
fn write_type_format<W: Write>(
self,
type_format: u16,
w: &mut W
) -> Result<State<PropertyId>>
self,
type_format: u16,
w: &mut W
) -> Result<State<PropertyId>>
Writes type format.
fn read_type_format<R: Read>(
self,
type_format: &mut u16,
r: &mut R
) -> Result<State<PropertyId>>
self,
type_format: &mut u16,
r: &mut R
) -> Result<State<PropertyId>>
Reads type format.
fn end_type_formats<W: Write>(self, w: &mut W) -> Result<()>
Ends writing state.
impl State<PropertyId>
[src]
fn write_property_id<W: Write>(
self,
property_id: u16,
w: &mut W
) -> Result<State<Bytes>>
self,
property_id: u16,
w: &mut W
) -> Result<State<Bytes>>
Writes property id.
fn read_property_id<R: Read>(
self,
property_id: &mut u16,
r: &mut R
) -> Result<State<Bytes>>
self,
property_id: &mut u16,
r: &mut R
) -> Result<State<Bytes>>
Reads property id.
impl State<Bytes>
[src]
fn write_bytes<W: Write>(
self,
bytes: u64,
w: &mut W
) -> Result<State<OffsetInstanceId>>
self,
bytes: u64,
w: &mut W
) -> Result<State<OffsetInstanceId>>
Writes number of bytes in data.
fn read_bytes<R: Read>(
self,
bytes: &mut u64,
r: &mut R
) -> Result<State<OffsetInstanceId>>
self,
bytes: &mut u64,
r: &mut R
) -> Result<State<OffsetInstanceId>>
Reads bytes.
fn end_bytes<W: Write>(self, w: &mut W) -> Result<State<TypeFormat>>
Ends byte block.
fn has_end_bytes<R: Read>(self, r: &mut R) -> Result<State<TypeFormat>>
Checks if this is the end of bytes.
impl State<OffsetInstanceId>
[src]
fn write_offset_instance_id<W: Write>(
self,
offset_instance_id: u64,
w: &mut W
) -> Result<State<Data>>
self,
offset_instance_id: u64,
w: &mut W
) -> Result<State<Data>>
Writes offset instance id.
fn read_offset_instance_id<R: Read>(
self,
offset_instance_id: &mut u64,
r: &mut R
) -> Result<State<Data>>
self,
offset_instance_id: &mut u64,
r: &mut R
) -> Result<State<Data>>
Reads offset instance id.