Skip to main content

Storage

Trait Storage 

Source
pub trait Storage
where Self: Debug + Clone + Send + 'static,
{ // Required methods fn reader_at(&mut self, key: &str) -> Result<BoxReaderAt, Error>; fn writer(&mut self, key: &str) -> Result<BoxWriter, Error>; }
Expand description

This trait defines the behavior required to read and write data to persistent storage.

Required Methods§

Source

fn reader_at(&mut self, key: &str) -> Result<BoxReaderAt, Error>

Get a positional reader for the given key.

The returned handle is the only read API rotbl uses: both the one-shot metadata parsing in Rotbl::open and the concurrent block-load hot path go through ReaderAt::read_exact_at. Backends are expected to use positional I/O (pread, etc.) so that N concurrent block loads can progress in parallel.

Source

fn writer(&mut self, key: &str) -> Result<BoxWriter, Error>

Get a writer to write data to a specific key in the storage.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§