#[non_exhaustive]pub struct Stats { /* private fields */ }Expand description
The Nom metric suite.
Implementations§
Source§impl Stats
impl Stats
Sourcepub fn functions_sum(&self) -> u64
pub fn functions_sum(&self) -> u64
Return the sum metric for functions
Sourcepub fn closures_sum(&self) -> u64
pub fn closures_sum(&self) -> u64
Return the sum metric for closures
Sourcepub fn functions_average(&self) -> f64
pub fn functions_average(&self) -> f64
Returns the average number of function definitions over all spaces.
nom’s averages are per space (space_count). The .max(1)
guard keeps a space-less aggregate from dividing by zero
(space_count defaults to 1 and only grows, so today it is a
no-op, but the guard removes the reliance on that invariant — cf.
the divisor guards added for #428).
Sourcepub fn closures_average(&self) -> f64
pub fn closures_average(&self) -> f64
Returns the average number of closures over all spaces.
Sourcepub fn average(&self) -> f64
pub fn average(&self) -> f64
Returns the average number of function definitions and closures over all spaces.
Sourcepub fn functions_min(&self) -> u64
pub fn functions_min(&self) -> u64
Counts the number of function definitions in a scope.
Collapses the usize::MAX sentinel that Stats::default() plants
into functions_min to 0.0, so a never-observed space
serializes to a meaningful number rather than 1.8446744e19.
Sourcepub fn closures_min(&self) -> u64
pub fn closures_min(&self) -> u64
Counts the number of closures in a scope.
Same usize::MAX sentinel collapse as functions_min.
Sourcepub fn functions_max(&self) -> u64
pub fn functions_max(&self) -> u64
Counts the number of function definitions in a scope
Sourcepub fn closures_max(&self) -> u64
pub fn closures_max(&self) -> u64
Counts the number of closures in a scope