# BindingEvaluator

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/utils/struct-bindingevaluator/

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

```rust
struct BindingEvaluator
```

Evaluates a binding against arbitrary data contexts.

The value is untyped; `evaluate_string` gives
its text form for the consumers that evaluate text.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/binding_evaluator.rs#L17)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`value_property`](#function-value_property)
- [`new`](#function-new)
- [`value`](#function-value)
- [`set_evaluated_value`](#function-set_evaluated_value)
- [`evaluate`](#function-evaluate)
- [`evaluate_string`](#function-evaluate_string)
- [`update_binding`](#function-update_binding)
- [`clear_data_context`](#function-clear_data_context)
- [`dispose`](#function-dispose)
- [`try_create`](#function-try_create)

<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/utils/binding_evaluator.rs#L23)

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

### to_ref

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

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/binding_evaluator.rs#L23)

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

### value_property

```rust
fn value_property() -> &'static StyledProperty<Option<BoxedValue>>
```

Defines the `Value` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/binding_evaluator.rs#L27)

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

### new

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/binding_evaluator.rs#L37)

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

### value

```rust
fn value(self: &Self) -> Option<BoxedValue>
```

The evaluated value.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/binding_evaluator.rs#L46)

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

### set_evaluated_value

```rust
fn set_evaluated_value(self: &Self, value: Option<BoxedValue>)
```

Sets the evaluated value (the setter of `Value`; `set_value` is the property setter
of every object).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/binding_evaluator.rs#L52)

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

### evaluate

```rust
fn evaluate(self: &Self, data_context: &Option<BoxedValue>) -> Option<BoxedValue>
```

Evaluates the binding against a data context.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/binding_evaluator.rs#L57)

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

### evaluate_string

```rust
fn evaluate_string(self: &Self, data_context: &Option<BoxedValue>) -> Option<String>
```

Evaluates the binding against a data context and returns the text
form of the value, if it has one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/binding_evaluator.rs#L68)

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

### update_binding

```rust
fn update_binding(self: &Self, binding: &AssignedBinding)
```

Replaces the evaluated binding.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/binding_evaluator.rs#L74)

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

### clear_data_context

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

Clears the data context.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/binding_evaluator.rs#L88)

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

### dispose

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

Releases the binding.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/binding_evaluator.rs#L93)

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

### try_create

```rust
fn try_create(binding: Option<&AssignedBinding>) -> Option<Ref<BindingEvaluator>>
```

Creates an evaluator for a binding, if there is one.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/utils/binding_evaluator.rs#L102)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `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/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`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<BindingEvaluator>`](/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/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)

## Availability

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