# SortOptimisations

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-dynamic-data/cache/struct-sortoptimisations/

**struct** · [`ferroui-dynamic-data`](/docs/0.5.0/api/ferroui-dynamic-data/) · v0.5.0

```rust
struct SortOptimisations
```

The optimisations of a sort of a cache (`[Flags] enum SortOptimisations`): a set of flags.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/cache/sort_optimisations.rs#L8)

## Members

- [`NONE`](#assoc_const-none)
- [`COMPARES_IMMUTABLE_VALUES_ONLY`](#assoc_const-compares_immutable_values_only)
- [`IGNORE_EVALUATES`](#assoc_const-ignore_evaluates)
- [`INSERT_AT_END_THEN_SORT`](#assoc_const-insert_at_end_then_sort)
- [`bits`](#function-bits)
- [`has_flag`](#function-has_flag)

<a id="assoc_const-none"></a>

### NONE

```rust
const NONE: Self
```

No optimisation (`None`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/cache/sort_optimisations.rs#L12)

<a id="assoc_const-compares_immutable_values_only"></a>

### COMPARES_IMMUTABLE_VALUES_ONLY

```rust
const COMPARES_IMMUTABLE_VALUES_ONLY: Self
```

The comparer reads values that never change, so the current position of an item is found
with a binary search (`ComparesImmutableValuesOnly`). The comparer must also give each item
a unique position.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/cache/sort_optimisations.rs#L17)

<a id="assoc_const-ignore_evaluates"></a>

### IGNORE_EVALUATES

```rust
const IGNORE_EVALUATES: Self
```

A refresh does not move items: the collection is sorted again without moves
(`IgnoreEvaluates`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/cache/sort_optimisations.rs#L21)

<a id="assoc_const-insert_at_end_then_sort"></a>

### INSERT_AT_END_THEN_SORT

```rust
const INSERT_AT_END_THEN_SORT: Self
```

No longer used upstream; the value of both other flags (`InsertAtEndThenSort`, obsolete).

> **Deprecated.** This is no longer being used. Use one of the other options instead.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/cache/sort_optimisations.rs#L25)

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

### bits

```rust
const fn bits(self: Self) -> u32
```

The flags as a number.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/cache/sort_optimisations.rs#L28)

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

### has_flag

```rust
const fn has_flag(self: Self, flag: Self) -> bool
```

Whether every flag of `flag` is set (`Enum.HasFlag`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.DynamicData/cache/sort_optimisations.rs#L33)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- `Equivalent<K>`
- `Clone`
- `Copy`
- `Default`
- `StructuralPartialEq`
- `PartialEq`
- `Eq`
- `Hash`
- `BitOr`
- `BitOrAssign`
- `BitAnd`
- `Debug`

## Availability

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