FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ChainedComparer

    struct · ferroui-reactiveui · v0.5.0

    struct ChainedComparer<T>
    

    A comparer that applies a parent comparer, then a comparison to break its ties (ChainedComparer<T>): the chain that then_by and order_by build.

    Deviation (DEVIATIONS.md, ReactiveUI): upstream's class is internal; it is public here so that its tests, in their own crate, reach it. Upstream also returns 0 for two null values before it asks the comparison; a value here cannot be null, and an optional value compares through the comparison it is given (None equals None).

    View source

    Members

    new

    fn new(parent: Option<Comparer<T>>, comparison: impl Fn(&T, &T) -> Ordering + 'static) -> Self
    

    A comparer that applies parent, if any, then comparison (ChainedComparer(IComparer<T>?, Comparison<T>)).

    Source

    compare

    fn compare(self: &Self, x: &T, y: &T) -> Ordering
    

    The order of x and y: the parent's, unless it finds them equal (Compare).

    Source

    into_comparer

    fn into_comparer(self: Self) -> Comparer<T>
    

    The comparer as the shared comparison function that sorting takes.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.