Trait winter_utils::ByteReader[][src]

pub trait ByteReader {
    fn read_u8(&mut self) -> Result<u8, DeserializationError>;
fn read_u16(&mut self) -> Result<u16, DeserializationError>;
fn read_u32(&mut self) -> Result<u32, DeserializationError>;
fn read_u64(&mut self) -> Result<u64, DeserializationError>;
fn read_u128(&mut self) -> Result<u128, DeserializationError>;
fn read_u8_vec(
        &mut self,
        len: usize
    ) -> Result<Vec<u8>, DeserializationError>;
fn read_u8_array<const N: usize>(
        &mut self
    ) -> Result<[u8; N], DeserializationError>;
fn has_more_bytes(&self) -> bool; }
Expand description

Defines how primitive values are to be read from Self.

Required methods

Returns a single byte read from self.

Errors

Returns a DeserializationError error the reader is at EOF.

Returns a u16 value read from self in little-endian byte order.

Errors

Returns a DeserializationError if a u16 value could not be read from self.

Returns a u32 value read from self in little-endian byte order.

Errors

Returns a DeserializationError if a u32 value could not be read from self.

Returns a u64 value read from self in little-endian byte order.

Errors

Returns a DeserializationError if a u64 value could not be read from self.

Returns a u128 value read from self in little-endian byte order.

Errors

Returns a DeserializationError if a u128 value could not be read from self.

Returns a byte vector of the specified length read from self.

Errors

Returns a DeserializationError if a vector of the specified length could not be read from self.

Returns a byte array of length N reade from self.

Returns true if there are more bytes left to be read from self.

Implementors