# LocalBindingReload

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/data/struct-localbindingreload/

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

```rust
struct LocalBindingReload<T: PropertyValue>
```

A prepared replacement (or removal) of a supported local binding on a
preserved object. Preparation constructs an inactive expression for the
actual target; it does not start subscriptions or change the visible value.

This primitive is for explicit reload adapters. The adapter must establish
XAML ownership and supply the correct source, namescope and service context.
Synchronous one/two-way bindings are supported; other expression kinds fail
preparation. Direct properties, animations and arbitrary observer side
effects are outside this contract.

Commit retains the original subscriptions until `finish`. `rollback` restores
the original expression and user input without sending that input to either
model. Dropping an unfinished change attempts rollback.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/local_binding_reload.rs#L20)

## Members

- [`prepare`](#function-prepare)
- [`prepare_value`](#function-prepare_value)
- [`commit`](#function-commit)
- [`rollback`](#function-rollback)
- [`finish`](#function-finish)

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

### prepare

```rust
fn prepare(target: &Ref<FerroObject>, property: &'static StyledProperty<T>, replacement: Option<&dyn BindingBase>, anchor: Option<&Ref<FerroObject>>) -> Result<Self, String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/local_binding_reload.rs#L42)

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

### prepare_value

```rust
fn prepare_value(target: &Ref<FerroObject>, property: &'static StyledProperty<T>, value: Option<T>) -> Result<Self, String>
```

Replaces a binding with a converted literal, or clears its contribution.

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

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

### commit

```rust
fn commit(self: &mut Self) -> Result<(), String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/local_binding_reload.rs#L109)

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

### rollback

```rust
fn rollback(self: &mut Self) -> Result<(), String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/local_binding_reload.rs#L177)

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

### finish

```rust
fn finish(self: &mut Self) -> Result<(), String>
```

Accepts the replacement and releases the original subscriptions.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/data/local_binding_reload.rs#L234)

## 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`
- `Drop`

## Availability

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