pub trait InlinableRead: Read {
    // Provided methods
    fn read_len_with_width<const N: usize>(&mut self) -> Result<usize> { ... }
    fn read_f32(&mut self) -> Result<f32> { ... }
    fn read_f64(&mut self) -> Result<f64> { ... }
    fn read_u8(&mut self) -> Result<u8> { ... }
    fn read_u16(&mut self) -> Result<u16> { ... }
    fn read_u32(&mut self) -> Result<u32> { ... }
    fn read_u64(&mut self) -> Result<u64> { ... }
    fn read_u128(&mut self) -> Result<u128> { ... }
    fn read_len_with_data<const N: usize>(&mut self) -> Result<Vec<u8>> { ... }
    fn read_inlined_bytes<const N: usize>(&mut self) -> Result<Vec<u8>> { ... }
    fn read_inlined_str<const N: usize>(&mut self) -> Result<String> { ... }
    fn read_inlinable<T: Inlinable>(&mut self) -> Result<T>
       where Self: Sized { ... }
}

Provided Methods§

source

fn read_len_with_width<const N: usize>(&mut self) -> Result<usize>

Read N bytes as usize.

Only 1/2/4/8 is valid as N.

source

fn read_f32(&mut self) -> Result<f32>

source

fn read_f64(&mut self) -> Result<f64>

source

fn read_u8(&mut self) -> Result<u8>

source

fn read_u16(&mut self) -> Result<u16>

source

fn read_u32(&mut self) -> Result<u32>

source

fn read_u64(&mut self) -> Result<u64>

source

fn read_u128(&mut self) -> Result<u128>

source

fn read_len_with_data<const N: usize>(&mut self) -> Result<Vec<u8>>

Read a bytes len with width N and the next len - N bytes into a Vec

The bytes contains:

+--------------+-----------------+
| len: N bytes | data: len - N bytes |
+--------------+-----------------+
source

fn read_inlined_bytes<const N: usize>(&mut self) -> Result<Vec<u8>>

Read inlined bytes with specific length width N.

The inlined bytes are constructed as:

+--------------+-----------------+
| len: N bytes | data: len bytes |
+--------------+-----------------+
source

fn read_inlined_str<const N: usize>(&mut self) -> Result<String>

Read inlined string with specific length width N.

The inlined string are constructed as:

+--------------+-----------------+
| len: N bytes | data: len bytes |
+--------------+-----------------+
source

fn read_inlinable<T: Inlinable>(&mut self) -> Result<T>where Self: Sized,

Read some bytes into inlinable object.

Implementors§

source§

impl<T> InlinableRead for Twhere T: Read,