pub struct PrecisionStats {
pub num_conversions: usize,
pub memory_saved: usize,
pub avg_error: f64,
pub max_error: f64,
}Expand description
Statistics about precision conversion
Fields§
§num_conversions: usizeNumber of conversions performed
memory_saved: usizeTotal memory saved (bytes)
avg_error: f64Average numerical error from conversion
max_error: f64Maximum numerical error observed
Implementations§
Source§impl PrecisionStats
impl PrecisionStats
Sourcepub fn record_conversion(
&mut self,
original_size: usize,
precision_mode: &PrecisionMode,
)
pub fn record_conversion( &mut self, original_size: usize, precision_mode: &PrecisionMode, )
Record a conversion
Sourcepub fn record_error(&mut self, error: f64)
pub fn record_error(&mut self, error: f64)
Record numerical error
Sourcepub fn memory_saved_mb(&self) -> f64
pub fn memory_saved_mb(&self) -> f64
Get memory saved in MB
Trait Implementations§
Source§impl Clone for PrecisionStats
impl Clone for PrecisionStats
Source§fn clone(&self) -> PrecisionStats
fn clone(&self) -> PrecisionStats
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 moreSource§impl Debug for PrecisionStats
impl Debug for PrecisionStats
Source§impl Default for PrecisionStats
impl Default for PrecisionStats
Source§fn default() -> PrecisionStats
fn default() -> PrecisionStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PrecisionStats
impl RefUnwindSafe for PrecisionStats
impl Send for PrecisionStats
impl Sync for PrecisionStats
impl Unpin for PrecisionStats
impl UnwindSafe for PrecisionStats
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