# InternalSelectionModel

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

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

```rust
struct InternalSelectionModel
```

The selection model of the selecting items controls: an untyped
selection model that keeps a writable list of the selected items in sync
with the selection, both ways.

It derives from the untyped [`SelectionModel`](/docs/0.5.0/api/ferroui-controls/selection/struct-selectionmodel/): it owns the model,
overrides its virtual members through [`SelectionModelImpl`](/docs/0.5.0/api/ferroui-controls/selection/trait-selectionmodelimpl/) and
dereferences to it, so every member of the model is available on it. It
implements [`ISelectionModel`](/docs/0.5.0/api/ferroui-controls/selection/trait-iselectionmodel/) itself, so an `Rc<InternalSelectionModel>`
is used wherever an `Rc<dyn ISelectionModel>` is expected.

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

## Members

- [`new`](#function-new)
- [`model`](#function-model)
- [`writable_selected_items`](#function-writable_selected_items)
- [`set_writable_selected_items`](#function-set_writable_selected_items)
- [`update`](#function-update)

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

### new

```rust
fn new() -> Rc<Self>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/selection/internal_selection_model.rs#L52)

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

### model

```rust
fn model(self: &Self) -> &Rc<SelectionModel<BoxedValue>>
```

The untyped selection model this model derives from.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/selection/internal_selection_model.rs#L93)

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

### writable_selected_items

```rust
fn writable_selected_items(self: &Self) -> WritableSelectedItems
```

Gets the writable list of the selected items.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/selection/internal_selection_model.rs#L98)

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

### set_writable_selected_items

```rust
fn set_writable_selected_items(self: &Self, value: Option<WritableSelectedItems>)
```

Sets the writable list of the selected items; `None` assigns a new,
empty list.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/selection/internal_selection_model.rs#L114)

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

### update

```rust
fn update(self: &Self, source: Option<ItemsSource>, selected_items: Option<Option<WritableSelectedItems>>)
```

Assigns the source and, if given, the writable list of the selected
items in one step.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/selection/internal_selection_model.rs#L134)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`SelectionModelImpl<Rc<dyn AnyValue>>`](/docs/0.5.0/api/ferroui-controls/selection/trait-selectionmodelimpl/)
- [`INotifyPropertyChanged`](/docs/0.5.0/api/ferroui-base/data/model/use-inotifypropertychanged/)
- [`ISelectionModel`](/docs/0.5.0/api/ferroui-controls/selection/trait-iselectionmodel/)

## Availability

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