# CapturedControlState

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

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

```rust
trait CapturedControlState
```

State restored only after the complete revision succeeds and layout is updated.
Normally runs on the dispatcher; a subsequent reload completes pending state
before preparing its candidate. Identity must be unique on both sides and the
control's runtime type must be unchanged. Failed/superseded revisions discard
the snapshot without invoking this callback.

Restore must not panic. It is an application callback after commit, not a
reversible transaction. Authored values, bindings and new application state
take precedence over the snapshot; use the context's property guard and any
additional checks required by the custom control. Do not reenter the same
session from this callback; post additional reload work to the dispatcher.

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

## Members

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

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

### restore

```rust
fn restore(self: &Self, control: &Ref<StyledElement>, context: &ControlStateRestoreContext<'_>)
```



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

## Availability

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