Struct everscale_types::cell::StorageStat
source · pub struct StorageStat<'a> { /* private fields */ }Expand description
A helper to track the size of the unique data in multiple cell trees.
NOTE: It uses hashes for deduplication, so you can only use it for fully computed and valid trees.
Implementations§
source§impl<'a> StorageStat<'a>
impl<'a> StorageStat<'a>
sourcepub fn compute_for_slice<'b: 'a>(
slice: &'a CellSlice<'b>,
limit: usize,
) -> Option<CellTreeStats>
pub fn compute_for_slice<'b: 'a>( slice: &'a CellSlice<'b>, limit: usize, ) -> Option<CellTreeStats>
Recursively computes the count of distinct cells returning the total storage used by this dag taking into account the identification of equal cells.
Root slice does not count as cell. A slice subrange of cells is used during computation.
sourcepub fn compute_for_cell(
cell: &'a DynCell,
limit: usize,
) -> Option<CellTreeStats>
pub fn compute_for_cell( cell: &'a DynCell, limit: usize, ) -> Option<CellTreeStats>
Recursively computes the count of distinct cells returning the total storage used by this dag taking into account the identification of equal cells.
sourcepub fn with_limit(limit: usize) -> Self
pub fn with_limit(limit: usize) -> Self
Creates a new storage stat state with an explicit limit.
sourcepub fn stats(&self) -> CellTreeStats
pub fn stats(&self) -> CellTreeStats
Returns the current tree stats.
Auto Trait Implementations§
impl<'a> Freeze for StorageStat<'a>
impl<'a> !RefUnwindSafe for StorageStat<'a>
impl<'a> Send for StorageStat<'a>
impl<'a> Sync for StorageStat<'a>
impl<'a> Unpin for StorageStat<'a>
impl<'a> !UnwindSafe for StorageStat<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more