pub struct Store<S: TileStore> { /* private fields */ }Expand description
The store: the data writer, the manifest writer when split, the live runs, and the size a trusted checkpoint covers.
Implementations§
Source§impl<S: TileStore> Store<S>
impl<S: TileStore> Store<S>
Sourcepub fn open(store: S, keys: Keys) -> Result<Self, Error>
pub fn open(store: S, keys: Keys) -> Result<Self, Error>
Opens a shared log on store with the writer lock, rebuilding the
live set from the logged manifests when the cache does not match them.
Sourcepub fn open_split(data: S, index: S, keys: Keys) -> Result<Self, Error>
pub fn open_split(data: S, index: S, keys: Keys) -> Result<Self, Error>
Opens a split log: entries go to data, run files and manifests to
index. Both writer locks are held.
Sourcepub fn open_trusting(
store: S,
keys: Keys,
size: u64,
root: [u8; 32],
) -> Result<Self, Error>
pub fn open_trusting( store: S, keys: Keys, size: u64, root: [u8; 32], ) -> Result<Self, Error>
Like Store::open, trusting root as the root at size: what
AuthenticatedLog::recover proves the current data tree consistent
with. The pair comes from a signed checkpoint kept where the store’s
writer cannot reach it.
Sourcepub fn live_runs(&self) -> &[RunManifest]
pub fn live_runs(&self) -> &[RunManifest]
The runs a lookup goes through, oldest first.
Sourcepub fn index_writer(&self) -> Option<&Writer<S>>
pub fn index_writer(&self) -> Option<&Writer<S>>
The index log’s writer when split, for its own checkpoint.
Sourcepub fn index(&self) -> Result<Index<&S>, Error>
pub fn index(&self) -> Result<Index<&S>, Error>
Lookups at the current trees, sharing this store’s run cache.
Trait Implementations§
Source§impl<S: TileStore> AuthenticatedLog for Store<S>
impl<S: TileStore> AuthenticatedLog for Store<S>
Source§fn append(&mut self, entry: &[u8]) -> Result<u64, Error>
fn append(&mut self, entry: &[u8]) -> Result<u64, Error>
Append one entry; returns its log index.
Source§fn find(&self, key: &[u8]) -> Result<Vec<Located>, Error>
fn find(&self, key: &[u8]) -> Result<Vec<Located>, Error>
Every entry carrying
key, each with the run that located it. An
empty answer is proven, not assumed: the logged runs’ entry ranges
cover every index below the checkpoint size except the scanned
tail, or the answer is Error::Tree, since a withheld run file
would otherwise hide an entry without doctoring any bytes.Source§fn range(&self, range: RangeInclusive<&[u8]>) -> Result<Vec<Located>, Error>
fn range(&self, range: RangeInclusive<&[u8]>) -> Result<Vec<Located>, Error>
Every entry whose keys fall in
range, in key order, with their runs.Auto Trait Implementations§
impl<S> Freeze for Store<S>where
S: Freeze,
impl<S> !RefUnwindSafe for Store<S>
impl<S> Send for Store<S>where
S: Send,
impl<S> Sync for Store<S>where
S: Sync,
impl<S> Unpin for Store<S>where
S: Unpin,
impl<S> UnsafeUnpin for Store<S>where
S: UnsafeUnpin,
impl<S> !UnwindSafe for Store<S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more