Trait kff::utils::read::KffRead

source ·
pub trait KffRead {
    // Required methods
    fn read_n_bytes<const N: usize>(&mut self) -> Result<[u8; N]>;
    fn read_n_bytes_dyn(&mut self, n: usize) -> Result<Vec<u8>>;
    fn read_ascii(&mut self) -> Result<Vec<u8>>;
    fn read_2bits(&mut self, k: usize) -> Result<BitVec<u8, Msb0>>;

    // Provided methods
    fn read_bool(&mut self) -> Result<bool> { ... }
    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_i64(&mut self) -> Result<i64> { ... }
}
Expand description

Define trait containts utils function to parsing kff

Required Methods§

source

fn read_n_bytes<const N: usize>(&mut self) -> Result<[u8; N]>

Function read N bytes (N define at compile time) in a readable

source

fn read_n_bytes_dyn(&mut self, n: usize) -> Result<Vec<u8>>

Function read N bytes (N define at run time) in a readable

source

fn read_ascii(&mut self) -> Result<Vec<u8>>

Function read a Kff ‘ascii’

source

fn read_2bits(&mut self, k: usize) -> Result<BitVec<u8, Msb0>>

Function some base in 2bits representation

Provided Methods§

source

fn read_bool(&mut self) -> Result<bool>

Function that read one bit and convert it as bool

source

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

Function that read u8

source

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

Function that read u16

source

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

Function that read u32

source

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

Function that read u64

source

fn read_i64(&mut self) -> Result<i64>

Function that read i64

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T> KffRead for T
where T: BufRead,