# ControlStateAdapter

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-hot-reload/trait-controlstateadapter/

**trait** · [`ferroui-hot-reload`](/docs/0.5.0/api/ferroui-hot-reload/) · v0.5.0

```rust
trait ControlStateAdapter
```

Capture application-specific state from a control before replacement.

Called only for controls with a source name or development key. Return `None`
for unsupported controls. Capture must not mutate the live tree. Store values
or application identities in the snapshot, not strong references to retired
controls. One adapter can support multiple control types.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.HotReload/control_state.rs#L10)

## Members

- [`capture`](#function-capture)

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

### capture

```rust
fn capture(self: &Self, control: &Ref<StyledElement>) -> Option<Box<dyn CapturedControlState>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.HotReload/control_state.rs#L11)

## Availability

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