pub trait Storage{
// 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§
Sourcefn reader_at(&mut self, key: &str) -> Result<BoxReaderAt, Error>
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".