Skip to main content

ExpertSource

Trait ExpertSource 

Source
pub trait ExpertSource: Send + Sync {
    // Required methods
    fn expert_len(&self, key: ExpertKey) -> Option<usize>;
    fn read_expert(&self, key: ExpertKey) -> Result<Vec<u8>>;
}
Expand description

Where expert bytes come from. Implementations must be cheap to call concurrently (positional reads, not a shared seek cursor).

Required Methods§

Source

fn expert_len(&self, key: ExpertKey) -> Option<usize>

The exact byte length of this expert, or None if the key does not exist. Used for budget accounting before reading.

Source

fn read_expert(&self, key: ExpertKey) -> Result<Vec<u8>>

Reads this expert’s complete bytes.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§