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