[][src]Struct merkletree::store::LevelCacheStore

pub struct LevelCacheStore<E: Element, R: Read + Send + Sync> { /* fields omitted */ }

The LevelCacheStore is used to reduce the on-disk footprint even further to the minimum at the cost of build time performance. Each LevelCacheStore is created with a StoreConfig object which contains the number of binary tree levels above the base that are 'cached'. This implementation has hard requirements about the on disk file size based on that number of levels, so on-disk files are tied, structurally to the configuration they were built with and can only be accessed with the same number of levels.

NOTE: Unlike other store types, writes of any kind are not supported (except deletion) since we're accessing specially crafted on-disk data that requires a particular access pattern dictated at the time of creation/compaction.

Methods

impl<E: Element, R: Read + Send + Sync> LevelCacheStore<E, R>[src]

pub fn new_from_disk_with_reader(
    store_range: usize,
    branches: usize,
    config: &StoreConfig,
    reader: ExternalReader<R>
) -> Result<Self>
[src]

Used for opening v2 compacted DiskStores.

pub fn set_external_reader(&mut self, reader: ExternalReader<R>) -> Result<bool>[src]

impl<E: Element, R: Read + Send + Sync> LevelCacheStore<E, R>[src]

pub fn store_size(&self) -> usize[src]

pub fn is_consistent_v1(
    store_range: usize,
    branches: usize,
    config: &StoreConfig
) -> Result<bool>
[src]

pub fn is_consistent(
    store_range: usize,
    branches: usize,
    config: &StoreConfig
) -> Result<bool>
[src]

pub fn store_read_range(&self, start: usize, end: usize) -> Result<Vec<u8>>[src]

pub fn store_read_into(
    &self,
    start: usize,
    end: usize,
    buf: &mut [u8]
) -> Result<()>
[src]

pub fn store_copy_from_slice(&mut self, _start: usize, _slice: &[u8])[src]

Trait Implementations

impl<E: Element, R: Read + Send + Sync> Debug for LevelCacheStore<E, R>[src]

impl<E: Element, R: Read + Send + Sync> Store<E> for LevelCacheStore<E, R>[src]

Auto Trait Implementations

impl<E, R> RefUnwindSafe for LevelCacheStore<E, R> where
    E: RefUnwindSafe,
    R: RefUnwindSafe

impl<E, R> Send for LevelCacheStore<E, R>

impl<E, R> Sync for LevelCacheStore<E, R>

impl<E, R> Unpin for LevelCacheStore<E, R> where
    E: Unpin,
    R: Unpin

impl<E, R> UnwindSafe for LevelCacheStore<E, R> where
    E: UnwindSafe,
    R: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,