pub struct Reader<S: TileStore> { /* private fields */ }Expand description
Reads a log at one tree state. Every entry it returns hashes to the leaf the checked tiles hold for its index.
Implementations§
Source§impl<S: TileStore> Reader<S>
impl<S: TileStore> Reader<S>
Sourcepub fn open(store: S, keys: KeyFn) -> Result<Self>
pub fn open(store: S, keys: KeyFn) -> Result<Self>
A reader at the tree state the store holds, with the log’s key function; the empty tree for a store without a state.
Sourcepub fn at(store: S, size: u64, root: Hash, keys: KeyFn) -> Result<Self>
pub fn at(store: S, size: u64, root: Hash, keys: KeyFn) -> Result<Self>
A reader that trusts root to be the root at size, which is how a
verified checkpoint opens a log.
Sourcepub fn open_checkpoint(
store: S,
origin: &str,
trusted: &[Verifier],
keys: KeyFn,
) -> Result<Self>
pub fn open_checkpoint( store: S, origin: &str, trusted: &[Verifier], keys: KeyFn, ) -> Result<Self>
A reader at the store’s published checkpoint, once a key in trusted
has signed it; the checkpoint’s origin has to be origin. This is how
a reader that does not trust the writer’s tree state opens a log.
Sourcepub fn find(&self, key: &[u8]) -> Result<Vec<u64>>
pub fn find(&self, key: &[u8]) -> Result<Vec<u64>>
Indices of every entry carrying key, ascending: through the
manifest ranges, the filters and the sidecars for sealed bundles, then
a scan of the unsealed one. A key is an identity hash or a value the
key function derives; each hit is checked on the entry itself.
Sourcepub fn hashes(&self) -> &TileHashReader<S>
pub fn hashes(&self) -> &TileHashReader<S>
The checked tile reader.
Sourcepub fn get(&self, index: u64) -> Result<Option<Vec<u8>>>
pub fn get(&self, index: u64) -> Result<Option<Vec<u8>>>
Entry index, checked against its leaf hash; nothing past the size.
Sourcepub fn inclusion(&self, index: u64) -> Result<Option<Vec<Hash>>>
pub fn inclusion(&self, index: u64) -> Result<Option<Vec<Hash>>>
The inclusion proof for entry index, from checked tiles; the bytes
rfc9162::inclusion_proof gives over the flat leaf slice.