Trait ValueReader

Source
pub trait ValueReader: Default {
    type Value;

    // Required methods
    fn value(&self, idx: usize) -> &Self::Value;
    fn load(&mut self, data: &[u8]) -> Result<usize>;
}
Expand description

ValueReader is a trait describing the contract of something reading blocks of value, and offering random access within this values.

Required Associated Types§

Source

type Value

Type of the value being read.

Required Methods§

Source

fn value(&self, idx: usize) -> &Self::Value

Access the value at index idx, in the last block that was read via a call to ValueReader::read.

Source

fn load(&mut self, data: &[u8]) -> Result<usize>

Loads a block.

Returns the number of bytes that were read.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§