pub struct Printable {}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: UnitsImplementations§
Source§impl Printable
impl Printable
Sourcepub fn commas(value: &str) -> String
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.
Sourcepub fn commas_i64(value: i64) -> String
pub fn commas_i64(value: i64) -> String
Converts an i64 into a string with comma separators.
Sourcepub fn commas_u64(value: u64) -> String
pub fn commas_u64(value: u64) -> String
Converts a u64 into a string with comma separators.
Sourcepub fn scale_time(time: f64, hz: i64) -> (f64, String)
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.
Sourcepub fn print_integer(name: &str, value: i64, printer: &mut dyn Printer)
pub fn print_integer(name: &str, value: i64, printer: &mut dyn Printer)
Prints an integer statistic and its name in the standard format.
Sourcepub fn print_integer_units(
name: &str,
value: i64,
printer: &mut dyn Printer,
units: &Units,
)
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.
Sourcepub fn print_float(name: &str, value: f64, printer: &mut dyn Printer)
pub fn print_float(name: &str, value: f64, printer: &mut dyn Printer)
Prints a float statistic and its name in the standard format.
Sourcepub fn print_float_units(
name: &str,
value: f64,
printer: &mut dyn Printer,
units: &Units,
)
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.
Sourcepub fn print_float_unit(
name: &str,
value: f64,
unit: &str,
printer: &mut dyn Printer,
)
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.
Sourcepub fn format_float(value: f64) -> (String, String)
pub fn format_float(value: f64) -> (String, String)
Converts an f64 value into a mantissa and exponent string.
Sourcepub fn print_time(name: &str, time: f64, hz: i64, printer: &mut dyn Printer)
pub fn print_time(name: &str, time: f64, hz: i64, printer: &mut dyn Printer)
Prints a time value in human-usable form.
Sourcepub fn print_common_i64(&self, printer: &mut dyn Printer)
pub fn print_common_i64(&self, printer: &mut dyn Printer)
Prints the common statistics for i64 (integer) samples as passed in a Printable instance.
Sourcepub fn print_common_f64(&self, printer: &mut dyn Printer)
pub fn print_common_f64(&self, printer: &mut dyn Printer)
Prints the common statistics for f64 (float) samples as passed in a Printable instance.
Sourcepub fn print_common_float(&self, printer: &mut dyn Printer)
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.
Sourcepub fn log_mode_to_time(&self) -> f64
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.
Sourcepub fn print_common_integer_times(&self, hz: i64, printer: &mut dyn Printer)
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.
Sourcepub fn print_common_float_times(&self, hz: i64, printer: &mut dyn Printer)
pub fn print_common_float_times(&self, hz: i64, printer: &mut dyn Printer)
Prints the common f64 summary statistics for time samples.