Skip to main content

AuthenticatedLog

Trait AuthenticatedLog 

Source
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§

Source

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>

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>

Every entry whose keys fall in range, in key order, with their runs.

Source

fn seal(&mut self) -> Result<RunManifest, Error>

Seal the unsealed tail into a run and log its manifest.

Source

fn compact(&mut self) -> Result<Compaction, Error>

Merge runs into one and log the result.

Source

fn recover(&mut self) -> Result<Recovery, Error>

Replay past the last checkpoint and prove the result consistent.

Implementors§