# RecyclePool

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls-repeater/struct-recyclepool/

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

```rust
struct RecyclePool
```

Keyed element pool that preserves the owner when the same panel reuses an
element and detaches it when a different panel requests it.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/recycle_pool.rs#L48)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`put_element_core`](#function-put_element_core)
- [`try_get_element_core`](#function-try_get_element_core)
- [`reuse_key_property`](#function-reuse_key_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`put_element`](#function-put_element)
- [`put_element_with_owner`](#function-put_element_with_owner)
- [`try_get_element`](#function-try_get_element)
- [`try_get_element_with_owner`](#function-try_get_element_with_owner)
- [`get_reuse_key`](#function-get_reuse_key)
- [`set_reuse_key`](#function-set_reuse_key)
- [`get_origin_template`](#function-get_origin_template)
- [`set_origin_template`](#function-set_origin_template)
- [`get_pool_instance`](#function-get_pool_instance)
- [`set_pool_instance`](#function-set_pool_instance)
- [`count`](#function-count)

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

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/recycle_pool.rs#L53)

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

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<RecyclePool>
```

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/recycle_pool.rs#L53)

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

### put_element_core

```rust
fn put_element_core(self: &Self, element: Ref<Control>, key: &str, owner: Option<Ref<Control>>) -> Result<(), ElementFactoryError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/recycle_pool.rs#L53)

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

### try_get_element_core

```rust
fn try_get_element_core(self: &Self, key: &str, owner: Option<Ref<Control>>) -> Result<Option<Ref<Control>>, ElementFactoryError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/recycle_pool.rs#L53)

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

### reuse_key_property

```rust
fn reuse_key_property() -> &'static AttachedProperty<String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/recycle_pool.rs#L87)

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

### construct

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/recycle_pool.rs#L99)

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

### new

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/recycle_pool.rs#L105)

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

### put_element

```rust
fn put_element(self: &Self, element: Ref<Control>, key: &str) -> Result<(), ElementFactoryError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/recycle_pool.rs#L108)

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

### put_element_with_owner

```rust
fn put_element_with_owner(self: &Self, element: Ref<Control>, key: &str, owner: Option<Ref<Control>>) -> Result<(), ElementFactoryError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/recycle_pool.rs#L111)

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

### try_get_element

```rust
fn try_get_element(self: &Self, key: &str) -> Result<Option<Ref<Control>>, ElementFactoryError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/recycle_pool.rs#L119)

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

### try_get_element_with_owner

```rust
fn try_get_element_with_owner(self: &Self, key: &str, owner: Option<Ref<Control>>) -> Result<Option<Ref<Control>>, ElementFactoryError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/recycle_pool.rs#L122)

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

### get_reuse_key

```rust
fn get_reuse_key(element: &Control) -> String
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/recycle_pool.rs#L129)

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

### set_reuse_key

```rust
fn set_reuse_key(element: &Control, key: impl Into<String>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/recycle_pool.rs#L132)

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

### get_origin_template

```rust
fn get_origin_template(element: &Control) -> Option<Rc<dyn IDataTemplate>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/recycle_pool.rs#L135)

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

### set_origin_template

```rust
fn set_origin_template(element: &Control, template: Option<Rc<dyn IDataTemplate>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/recycle_pool.rs#L147)

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

### get_pool_instance

```rust
fn get_pool_instance(template: &Rc<dyn IDataTemplate>) -> Option<Ref<Self>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/recycle_pool.rs#L167)

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

### set_pool_instance

```rust
fn set_pool_instance(template: &Rc<dyn IDataTemplate>, pool: Option<Ref<Self>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/recycle_pool.rs#L177)

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

### count

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Repeater/recycle_pool.rs#L217)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`RecyclePoolImplExt`](/docs/0.5.0/api/ferroui-controls-repeater/trait-recyclepoolimplext/)
- `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`
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<RecyclePool>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`RecyclePoolImpl`](/docs/0.5.0/api/ferroui-controls-repeater/trait-recyclepoolimpl/)

## Availability

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