pub trait AuthenticatedLog {
// Required methods
fn append(&mut self, entry: &[u8]) -> Result<u64, Error>;
fn find(&self, key: &[u8]) -> Result<Vec<Located>, Error>;
fn range(&self, range: RangeInclusive<&[u8]>) -> Result<Vec<Located>, Error>;
fn seal(&mut self) -> Result<RunManifest, Error>;
fn compact(&mut self) -> Result<Compaction, Error>;
fn recover(&mut self) -> Result<Recovery, Error>;
}Expand description
The operations the log offers. Each returns the crate’s Error on a
store that cannot answer; a reader that distrusts the store checks the
paths these types carry against a checkpoint it trusts.
Required Methods§
Sourcefn append(&mut self, entry: &[u8]) -> Result<u64, Error>
fn append(&mut self, entry: &[u8]) -> Result<u64, Error>
Append one entry; returns its log index.
Sourcefn 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.
Sourcefn 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.
Sourcefn seal(&mut self) -> Result<RunManifest, Error>
fn seal(&mut self) -> Result<RunManifest, Error>
Seal the unsealed tail into a run and log its manifest.
Sourcefn compact(&mut self) -> Result<Compaction, Error>
fn compact(&mut self) -> Result<Compaction, Error>
Merge runs into one and log the result.