pub struct MemoryEstimate {
pub minimum: usize,
pub typical: usize,
pub maximum: usize,
}Expand description
Memory usage estimate for an operation.
This struct provides minimum, typical, and maximum memory estimates for decompression or compression operations.
§Example
use zesven::streaming::MemoryEstimate;
let estimate = MemoryEstimate::new(1024, 4096, 16384);
println!("Memory: {} - {} bytes (typical: {})",
estimate.minimum, estimate.maximum, estimate.typical);Fields§
§minimum: usizeMinimum memory required (best case scenario).
typical: usizeTypical memory usage under normal conditions.
maximum: usizeMaximum memory that could be used (worst case).
Implementations§
Source§impl MemoryEstimate
impl MemoryEstimate
Sourcepub fn new(minimum: usize, typical: usize, maximum: usize) -> Self
pub fn new(minimum: usize, typical: usize, maximum: usize) -> Self
Creates a new memory estimate.
Sourcepub fn add(&self, other: &MemoryEstimate) -> MemoryEstimate
pub fn add(&self, other: &MemoryEstimate) -> MemoryEstimate
Adds another estimate to this one.
Sourcepub fn format_human(&self) -> String
pub fn format_human(&self) -> String
Formats the estimate in human-readable form.
Trait Implementations§
Source§impl Clone for MemoryEstimate
impl Clone for MemoryEstimate
Source§fn clone(&self) -> MemoryEstimate
fn clone(&self) -> MemoryEstimate
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 moreimpl Copy for MemoryEstimate
Source§impl Debug for MemoryEstimate
impl Debug for MemoryEstimate
impl Eq for MemoryEstimate
Source§impl PartialEq for MemoryEstimate
impl PartialEq for MemoryEstimate
impl StructuralPartialEq for MemoryEstimate
Auto Trait Implementations§
impl Freeze for MemoryEstimate
impl RefUnwindSafe for MemoryEstimate
impl Send for MemoryEstimate
impl Sync for MemoryEstimate
impl Unpin for MemoryEstimate
impl UnsafeUnpin for MemoryEstimate
impl UnwindSafe for MemoryEstimate
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> 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