# ListPool

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/media/text_formatting/struct-listpool/

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

```rust
struct ListPool<T>
```

A pool of reusable lists.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/text_formatting/formatting_object_pool.rs#L46)

## Members

- [`rent`](#function-rent)
- [`return_list`](#function-return_list)
- [`return_optional`](#function-return_optional)
- [`verify_all_returned`](#function-verify_all_returned)

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

### rent

```rust
fn rent(self: &Self) -> RentedList<T>
```

Takes an empty list out of the pool.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/text_formatting/formatting_object_pool.rs#L61)

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

### return_list

```rust
fn return_list(self: &Self, rented_list: RentedList<T>)
```

Gives a list back to the pool. The items are dropped; the storage is kept.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/text_formatting/formatting_object_pool.rs#L72)

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

### return_optional

```rust
fn return_optional(self: &Self, rented_list: Option<RentedList<T>>)
```

Gives an optional list back to the pool (upstream accepts null).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/text_formatting/formatting_object_pool.rs#L85)

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

### verify_all_returned

```rust
fn verify_all_returned(self: &Self)
```

Checks (in debug builds) that every rented list was returned.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/media/text_formatting/formatting_object_pool.rs#L93)

## Trait implementations

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

## Availability

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