Trait il2_utils::simple_serialization::SimpleDataDeserializer [−][src]
pub trait SimpleDataDeserializer {
Show 13 methods
fn data(&self) -> &[u8];
fn read(&mut self, size: usize) -> Result<()>;
fn read_u8(&mut self) -> Result<u8> { ... }
fn read_i8(&mut self) -> Result<i8> { ... }
fn read_u16(&mut self) -> Result<u16> { ... }
fn read_u32(&mut self) -> Result<u32> { ... }
fn read_u64(&mut self) -> Result<u64> { ... }
fn read_i16(&mut self) -> Result<i16> { ... }
fn read_i32(&mut self) -> Result<i32> { ... }
fn read_i64(&mut self) -> Result<i64> { ... }
fn read_f32(&mut self) -> Result<f32> { ... }
fn read_f64(&mut self) -> Result<f64> { ... }
fn read_byte_array(&mut self) -> Result<()> { ... }
}Expand description
This trait implements a simple deserializer for basic data types.
It follows the format used by Java’s java.io.DataOutputStream so it
reads the values using the big endian format.
This trait also allows the definition of a custom Result type thar will
allow its methods to be used with the operatior ?.
Required methods
Provided methods
fn read_byte_array(&mut self) -> Result<()>
fn read_byte_array(&mut self) -> Result<()>
Writes a byte array. The size of the byte array is encoded as an u16 value followed by the bytes of the array.
Arguments:
v: The value to write;