Modeable

Trait Modeable 

Source
pub trait Modeable:
    ModeableSealed
    + Sized
    + Clone
    + Eq
    + Ord {
    // Provided method
    fn mode_across(
        items: impl IntoIterator<Item = Self>,
    ) -> Option<(Self, usize, usize)> { ... }
}
Expand description

Marker for newtypes reduced by mode (most-frequent value). Implemented by CategoricalString.

mode_across returns None when the input iterator is empty. Ties break by ascending sort order on the value type to match the existing crate::ctprof_compare::aggregate crate::ctprof_compare::AggRule::Mode contract: “lexicographically smaller wins” for equal-frequency strings.

Sealed via sealed::ModeableSealed: a downstream crate cannot write impl Modeable for u64 because the sealed supertrait is private to this module.

Provided Methods§

Source

fn mode_across( items: impl IntoIterator<Item = Self>, ) -> Option<(Self, usize, usize)>

Returns (mode_value, count, total) over the input iterator, or None when the iterator is empty.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§