# selection

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/selection/

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

```rust
module selection
```

Selection models.
## Inheritance among the selection classes

The selection classes form a small hierarchy with virtual members
(node base, selection model, internal selection model) but are plain
shared structs, not part of the class model. Their virtual members are
modelled explicitly, one level at a time:

- [`SelectionNodeBase`](/docs/0.5.0/api/ferroui-controls/selection/struct-selectionnodebase/) holds the state of the base class. Its inherent
  methods are the base implementations of the virtual members, which are
  declared by [`SelectionNodeBaseImpl`](/docs/0.5.0/api/ferroui-controls/selection/trait-selectionnodebaseimpl/). The base holds a weak reference
  to the object deriving from it and makes every virtual call through
  that reference.
- [`SelectionModel`](/docs/0.5.0/api/ferroui-controls/selection/struct-selectionmodel/) embeds the node base and implements
  [`SelectionNodeBaseImpl`](/docs/0.5.0/api/ferroui-controls/selection/trait-selectionnodebaseimpl/). Its own implementation of each virtual
  member is the `base_*` method of the same name; the member can be
  overridden once more by a type deriving from the model, which
  implements [`SelectionModelImpl`](/docs/0.5.0/api/ferroui-controls/selection/trait-selectionmodelimpl/) and registers itself with
  `SelectionModel::set_derived`. A virtual call reaches the override
  if there is one, the `base_*` method otherwise; an override calls the
  `base_*` method where the managed code calls the base implementation.
- [`InternalSelectionModel`](/docs/0.5.0/api/ferroui-controls/selection/struct-internalselectionmodel/) owns an untyped model, overrides the
  assignment of the source and the handling of source collection changes
  through [`SelectionModelImpl`](/docs/0.5.0/api/ferroui-controls/selection/trait-selectionmodelimpl/), and dereferences to the model.

The typed model is `SelectionModel<T>`; items are `Option<T>`, a null
item being `None`. The untyped model is `SelectionModel<BoxedValue>`.
[`ISelectionModel`](/docs/0.5.0/api/ferroui-controls/selection/trait-iselectionmodel/) is the untyped contract implemented by every model.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/selection/mod.rs#L1)

## Contents

- [`IndexRange`](/docs/0.5.0/api/ferroui-controls/selection/struct-indexrange/) — struct
- [`IndexRangeIndices`](/docs/0.5.0/api/ferroui-controls/selection/struct-indexrangeindices/) — struct
- [`selection_model_ptr_eq`](/docs/0.5.0/api/ferroui-controls/selection/function-selection_model_ptr_eq/) — function
- [`BatchUpdateOperation`](/docs/0.5.0/api/ferroui-controls/selection/struct-batchupdateoperation/) — struct
- [`ISelectionModel`](/docs/0.5.0/api/ferroui-controls/selection/trait-iselectionmodel/) — trait
- [`SelectionModelExtensions`](/docs/0.5.0/api/ferroui-controls/selection/struct-selectionmodelextensions/) — struct
- [`InternalSelectionModel`](/docs/0.5.0/api/ferroui-controls/selection/struct-internalselectionmodel/) — struct
- [`WritableSelectedItems`](/docs/0.5.0/api/ferroui-controls/selection/type_alias-writableselecteditems/) — type alias
- [`IReadOnlySelectionList`](/docs/0.5.0/api/ferroui-controls/selection/trait-ireadonlyselectionlist/) — trait
- [`ReadOnlySelectionList`](/docs/0.5.0/api/ferroui-controls/selection/struct-readonlyselectionlist/) — struct
- [`ReadOnlySelectionListBase`](/docs/0.5.0/api/ferroui-controls/selection/struct-readonlyselectionlistbase/) — struct
- [`SelectedIndexes`](/docs/0.5.0/api/ferroui-controls/selection/struct-selectedindexes/) — struct
- [`SelectedItems`](/docs/0.5.0/api/ferroui-controls/selection/struct-selecteditems/) — struct
- [`SelectedItemsUntyped`](/docs/0.5.0/api/ferroui-controls/selection/struct-selecteditemsuntyped/) — struct
- [`SelectionModel`](/docs/0.5.0/api/ferroui-controls/selection/struct-selectionmodel/) — struct
- [`SelectionModelImpl`](/docs/0.5.0/api/ferroui-controls/selection/trait-selectionmodelimpl/) — trait
- [`SelectionModelIndexesChangedEventArgs`](/docs/0.5.0/api/ferroui-controls/selection/struct-selectionmodelindexeschangedeventargs/) — struct
- [`SelectionModelSelectionChangedEventArgs`](/docs/0.5.0/api/ferroui-controls/selection/trait-selectionmodelselectionchangedeventargs/) — trait
- [`SelectionModelSelectionChangedEventArgsOf`](/docs/0.5.0/api/ferroui-controls/selection/struct-selectionmodelselectionchangedeventargsof/) — struct
- [`CollectionChangeState`](/docs/0.5.0/api/ferroui-controls/selection/struct-collectionchangestate/) — struct
- [`SelectionNodeBase`](/docs/0.5.0/api/ferroui-controls/selection/struct-selectionnodebase/) — struct
- [`SelectionNodeBaseImpl`](/docs/0.5.0/api/ferroui-controls/selection/trait-selectionnodebaseimpl/) — trait

## Availability

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