# ComparerChainingExtensions

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui/comparers/trait-comparerchainingextensions/

**trait** · [`ferroui-reactiveui`](/docs/0.5.0/api/ferroui-reactiveui/) · v0.5.0

```rust
trait ComparerChainingExtensions<T>
```

Chains a comparison onto a parent comparer (`ComparerChainingExtensions`): the result sorts by
the parent first, then, where the parent finds two elements equal, by the values of a selector.

It is implemented for a comparer and for an optional one (upstream's parent may be null, which
sorts by the selector alone).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/comparers/comparer_chaining_extensions.rs#L11)

## Members

- [`then_by`](#function-then_by)
- [`then_by_with`](#function-then_by_with)
- [`then_by_descending`](#function-then_by_descending)
- [`then_by_descending_with`](#function-then_by_descending_with)

<a id="function-then_by"></a>

### then_by

```rust
fn then_by<V: Ord + 'static>(self: &Self, selector: impl Fn(&T) -> V + 'static) -> Comparer<T>
```

Then in ascending order of the values of `selector`, compared by their `Ord`
(`ThenBy<TValue>(Func<T, TValue>)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/comparers/comparer_chaining_extensions.rs#L14)

<a id="function-then_by_with"></a>

### then_by_with

```rust
fn then_by_with<V: 'static>(self: &Self, selector: impl Fn(&T) -> V + 'static, comparer: Comparer<V>) -> Comparer<T>
```

Then in ascending order of the values of `selector`, compared by `comparer`
(`ThenBy<TValue>(Func<T, TValue>, IComparer<TValue>)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/comparers/comparer_chaining_extensions.rs#L18)

<a id="function-then_by_descending"></a>

### then_by_descending

```rust
fn then_by_descending<V: Ord + 'static>(self: &Self, selector: impl Fn(&T) -> V + 'static) -> Comparer<T>
```

Then in descending order of the values of `selector`, compared by their `Ord`
(`ThenByDescending<TValue>(Func<T, TValue>)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/comparers/comparer_chaining_extensions.rs#L22)

<a id="function-then_by_descending_with"></a>

### then_by_descending_with

```rust
fn then_by_descending_with<V: 'static>(self: &Self, selector: impl Fn(&T) -> V + 'static, comparer: Comparer<V>) -> Comparer<T>
```

Then in descending order of the values of `selector`, compared by `comparer`
(`ThenByDescending<TValue>(Func<T, TValue>, IComparer<TValue>)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/comparers/comparer_chaining_extensions.rs#L26)

## Trait implementations

- [`ComparerChainingExtensions<T>`](/docs/0.5.0/api/ferroui-reactiveui/comparers/trait-comparerchainingextensions/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
