pub struct Index<S: TileStore> { /* private fields */ }Expand description
Lookups at tree sizes and roots the caller trusts, without the writer locks. Every answer carries inclusion paths against those sizes: the entry’s against the data tree, the run manifest’s against the tree that holds the manifests (the same tree when shared), so a caller holding the signed checkpoints proves each hit with their roots and nothing from the store.
Implementations§
Source§impl<S: TileStore> Index<S>
impl<S: TileStore> Index<S>
Sourcepub fn at(
store: S,
size: u64,
root: [u8; 32],
keys: Keys,
) -> Result<Self, Error>
pub fn at( store: S, size: u64, root: [u8; 32], keys: Keys, ) -> Result<Self, Error>
Opens the lookups on a shared log at size with root.
Sourcepub fn with_cache(
store: S,
size: u64,
root: [u8; 32],
keys: Keys,
cache: RunCache,
) -> Result<Self, Error>
pub fn with_cache( store: S, size: u64, root: [u8; 32], keys: Keys, cache: RunCache, ) -> Result<Self, Error>
Like Index::at, sharing cache with other lookups on the same log.
Sourcepub fn at_split(
data_store: S,
data_size: u64,
data_root: [u8; 32],
index_store: S,
index_size: u64,
index_root: [u8; 32],
keys: Keys,
cache: RunCache,
) -> Result<Self, Error>
pub fn at_split( data_store: S, data_size: u64, data_root: [u8; 32], index_store: S, index_size: u64, index_root: [u8; 32], keys: Keys, cache: RunCache, ) -> Result<Self, Error>
Opens the lookups on a split log: the data tree at data_size with
data_root and the index log at index_size with index_root.
Sourcepub fn live_runs(&self) -> &[RunManifest]
pub fn live_runs(&self) -> &[RunManifest]
The runs a lookup goes through, oldest first.
Sourcepub fn manifest_reader(&self) -> &Reader<S>
pub fn manifest_reader(&self) -> &Reader<S>
The tiles reader that holds the manifests: the index log’s when split, the data log’s when shared.
Sourcepub fn find(&self, key: &[u8]) -> Result<Vec<Located>, Error>
pub fn find(&self, key: &[u8]) -> Result<Vec<Located>, Error>
Every entry carrying key, each with the run that located it; see
AuthenticatedLog::find.
Sourcepub fn range(&self, range: RangeInclusive<&[u8]>) -> Result<Vec<Located>, Error>
pub fn range(&self, range: RangeInclusive<&[u8]>) -> Result<Vec<Located>, Error>
Every entry whose keys fall in range, in key order, with their runs;
see AuthenticatedLog::range.