Printable

Struct Printable 

Source
pub struct Printable {
Show 14 fields pub n: u64, pub nans: u64, pub infinities: u64, pub min_i64: i64, pub max_i64: i64, pub min_f64: f64, pub max_f64: f64, pub mode_value: f64, pub log_mode: i64, pub mean: f64, pub variance: f64, pub skewness: f64, pub kurtosis: f64, pub units: Units,
}
Expand description

The Printable struct is used to pass data to the standard print functions shared by all the code. Developers who are implementing the Rustics trait for a new type might use this module.

Fields§

§n: u64§nans: u64§infinities: u64§min_i64: i64§max_i64: i64§min_f64: f64§max_f64: f64§mode_value: f64§log_mode: i64§mean: f64§variance: f64§skewness: f64§kurtosis: f64§units: Units

Implementations§

Source§

impl Printable

Source

pub fn commas(value: &str) -> String

The commas() function inserts commas into a string containing the character form of an integer. This input string might or might not have a leading “+” or “-” sign.

Source

pub fn commas_i64(value: i64) -> String

Converts an i64 into a string with comma separators.

Source

pub fn commas_u64(value: u64) -> String

Converts a u64 into a string with comma separators.

Source

pub fn scale_time(time: f64, hz: i64) -> (f64, String)

Converts a time interval in clock ticks into a human- readable value and unit. The chosen unit is returned as a string for printing.

Source

pub fn print_integer(name: &str, value: i64, printer: &mut dyn Printer)

Prints an integer statistic and its name in the standard format.

Source

pub fn print_integer_units( name: &str, value: i64, printer: &mut dyn Printer, units: &Units, )

Prints an integer statistic with its name and units in the standard format.

Source

pub fn print_float(name: &str, value: f64, printer: &mut dyn Printer)

Prints a float statistic and its name in the standard format.

Source

pub fn print_float_units( name: &str, value: f64, printer: &mut dyn Printer, units: &Units, )

Prints a float statistic in the standard format using a Units descriptor and a given printer.

Source

pub fn print_float_unit( name: &str, value: f64, unit: &str, printer: &mut dyn Printer, )

Prints a float value and its name along with a string specifying the units.

Source

pub fn format_float(value: f64) -> (String, String)

Converts an f64 value into a mantissa and exponent string.

Source

pub fn print_time(name: &str, time: f64, hz: i64, printer: &mut dyn Printer)

Prints a time value in human-usable form.

Source

pub fn print_common_i64(&self, printer: &mut dyn Printer)

Prints the common statistics for i64 (integer) samples as passed in a Printable instance.

Source

pub fn print_common_f64(&self, printer: &mut dyn Printer)

Prints the common statistics for f64 (float) samples as passed in a Printable instance.

Source

pub fn print_common_float(&self, printer: &mut dyn Printer)

Prints the common float statistics as passed in a Printable instance. This includes values like the mean.

Source

pub fn log_mode_to_time(&self) -> f64

Converts the pseudo-log mode of a time-based histogram into an approximate time for the bucket. Note that this approximation can be bigger than the maximum value since the pseudo-log function rounds up.

Source

pub fn print_common_integer_times(&self, hz: i64, printer: &mut dyn Printer)

Prints integer values that are in time units as actual times. The mode of the pseudo-log is an exception.

Source

pub fn print_common_float_times(&self, hz: i64, printer: &mut dyn Printer)

Prints the common f64 summary statistics for time samples.

Trait Implementations§

Source§

impl Clone for Printable

Source§

fn clone(&self) -> Printable

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.