pub trait Store: Send + Sync {
type Error: StdError + Send + Sync + 'static;
// Required methods
fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>, Self::Error>;
fn seek(&self, from: &[u8]) -> Result<Option<KeyValue>, Self::Error>;
fn seek_back(&self, upto: &[u8]) -> Result<Option<KeyValue>, Self::Error>;
fn commit(&self, ops: &[Op<'_>], durable: bool) -> Result<(), Self::Error>;
}Expand description
An ordered key/value byte store: the durable substrate under the queue.
Keys sort lexicographically. The queue needs forward and backward seeks and one atomic, optionally durable, batch write; it never asks the store to know anything about queues.
Required Associated Types§
Required Methods§
Sourcefn seek(&self, from: &[u8]) -> Result<Option<KeyValue>, Self::Error>
fn seek(&self, from: &[u8]) -> Result<Option<KeyValue>, Self::Error>
Smallest entry whose key is >= from.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".