pub struct BlockStatistics {
pub count: usize,
pub total_size: usize,
pub avg_size: f64,
pub min_size: usize,
pub max_size: usize,
pub median_size: usize,
}Expand description
Compute statistics for a collection of blocks
Fields§
§count: usizeTotal number of blocks
total_size: usizeTotal size in bytes
avg_size: f64Average block size
min_size: usizeMinimum block size
max_size: usizeMaximum block size
median_size: usizeMedian block size (approximate)
Implementations§
Source§impl BlockStatistics
impl BlockStatistics
Sourcepub fn from_blocks(blocks: &[Block]) -> Self
pub fn from_blocks(blocks: &[Block]) -> Self
Compute statistics from a block collection
Sourcepub fn estimated_memory_overhead(&self) -> usize
pub fn estimated_memory_overhead(&self) -> usize
Estimate memory overhead (CID + metadata)
Sourcepub fn total_memory_footprint(&self) -> usize
pub fn total_memory_footprint(&self) -> usize
Total memory footprint (data + overhead)
Trait Implementations§
Source§impl Clone for BlockStatistics
impl Clone for BlockStatistics
Source§fn clone(&self) -> BlockStatistics
fn clone(&self) -> BlockStatistics
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BlockStatistics
impl RefUnwindSafe for BlockStatistics
impl Send for BlockStatistics
impl Sync for BlockStatistics
impl Unpin for BlockStatistics
impl UnwindSafe for BlockStatistics
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more