Skip to main content

Index

Struct Index 

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

Source

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.

Source

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.

Source

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.

Source

pub fn live_runs(&self) -> &[RunManifest]

The runs a lookup goes through, oldest first.

Source

pub fn size(&self) -> u64

The data tree size the lookups answer at.

Source

pub fn reader(&self) -> &Reader<S>

The tiles reader of the data log, for entries and proofs.

Source

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.

Source

pub fn find(&self, key: &[u8]) -> Result<Vec<Located>, Error>

Every entry carrying key, each with the run that located it; see AuthenticatedLog::find.

Source

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.

Auto Trait Implementations§

§

impl<S> !Freeze for Index<S>

§

impl<S> !RefUnwindSafe for Index<S>

§

impl<S> !Send for Index<S>

§

impl<S> !Sync for Index<S>

§

impl<S> Unpin for Index<S>
where S: Unpin,

§

impl<S> UnsafeUnpin for Index<S>
where S: UnsafeUnpin,

§

impl<S> !UnwindSafe for Index<S>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.