# CellModelPool

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls-treedatagrid/presentation/struct-cellmodelpool/

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

```rust
struct CellModelPool
```

The cells of the columns of a presentation suspended for reuse (`CellModelPool<TModel>`).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/presentation/cell_model_pool.rs#L25)

## Members

- [`MAXIMUM_CELLS`](#assoc_const-maximum_cells)
- [`new`](#function-new)
- [`touch_column`](#function-touch_column)
- [`pop`](#function-pop)
- [`add`](#function-add)
- [`clear`](#function-clear)
- [`count`](#function-count)

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

### MAXIMUM_CELLS

```rust
const MAXIMUM_CELLS: usize
```

The most cells the pool keeps (`MaximumCells`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/presentation/cell_model_pool.rs#L33)

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

### new

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/presentation/cell_model_pool.rs#L36)

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

### touch_column

```rust
fn touch_column(self: &mut Self, column: &ColumnRef) -> bool
```

Whether the pool has a bucket for `column` (`_columns.TryGetValue`); a hit makes the bucket
the most recently used one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/presentation/cell_model_pool.rs#L68)

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

### pop

```rust
fn pop(self: &mut Self, column: &ColumnRef) -> Option<CellRef>
```

Removes the most recently pooled cell of `column` (`node.Value.Cells.Pop()`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/presentation/cell_model_pool.rs#L79)

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

### add

```rust
fn add(self: &mut Self, column: &ColumnRef, cell: CellRef, evicted: &mut Vec<CellRef>)
```

Keeps a suspended `cell` for `column` (the second half of `TryAdd`); the cells evicted to
keep the pool within its bounds are added to `evicted`, for the caller to dispose.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/presentation/cell_model_pool.rs#L88)

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

### clear

```rust
fn clear(self: &mut Self) -> Vec<CellRef>
```

Removes every cell (`Clear`); returns them for the caller to dispose.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/presentation/cell_model_pool.rs#L109)

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

### count

```rust
fn count(self: &Self) -> usize
```

The number of cells kept.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/TreeDataGrid/FerroUI.Controls.TreeDataGrid/presentation/cell_model_pool.rs#L118)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Default`

## Availability

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