pub struct BlockProfile {
pub cid: String,
pub raw_size_bytes: u64,
pub compressed_size_bytes: Option<u64>,
pub codec: Option<CompressionCodec>,
pub access_count: u64,
}Expand description
Profile tracking the size and access characteristics of a single block.
Fields§
§cid: StringContent identifier of the block.
raw_size_bytes: u64Size of the block before any compression is applied, in bytes.
compressed_size_bytes: Option<u64>Size after compression, if the block has been compressed.
codec: Option<CompressionCodec>Codec used for the current compressed copy, if any.
access_count: u64Number of times this block has been accessed.
Implementations§
Source§impl BlockProfile
impl BlockProfile
Sourcepub fn compression_ratio(&self) -> f64
pub fn compression_ratio(&self) -> f64
Returns the achieved compression ratio (raw / compressed).
Returns 1.0 when compression data is unavailable.
Sourcepub fn space_savings_bytes(&self) -> u64
pub fn space_savings_bytes(&self) -> u64
Returns the number of bytes saved by compression (raw − compressed).
Returns 0 when the block has not been compressed or when compression
actually expanded the block (saturating subtraction).
Trait Implementations§
Source§impl Clone for BlockProfile
impl Clone for BlockProfile
Source§fn clone(&self) -> BlockProfile
fn clone(&self) -> BlockProfile
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BlockProfile
impl Debug for BlockProfile
Source§impl PartialEq for BlockProfile
impl PartialEq for BlockProfile
Source§fn eq(&self, other: &BlockProfile) -> bool
fn eq(&self, other: &BlockProfile) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for BlockProfile
Auto Trait Implementations§
impl Freeze for BlockProfile
impl RefUnwindSafe for BlockProfile
impl Send for BlockProfile
impl Sync for BlockProfile
impl Unpin for BlockProfile
impl UnsafeUnpin for BlockProfile
impl UnwindSafe for BlockProfile
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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