# IBindingFallbackConverter

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui/binding/bindings/trait-ibindingfallbackconverter/

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

```rust
trait IBindingFallbackConverter
```

A converter that the bindings ask when no typed converter handles a pair of types
(`IBindingFallbackConverter`). It decides at run time, from the two types, whether and how well
it converts; `BindingFallbackConverterRegistry` picks
the one with the highest affinity.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/bindings/i_binding_fallback_converter.rs#L15)

## Members

- [`get_affinity_for_objects`](#function-get_affinity_for_objects)
- [`try_convert`](#function-try_convert)

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

### get_affinity_for_objects

```rust
fn get_affinity_for_objects(self: &Self, from_type: ConverterType, to_type: ConverterType) -> i32
```

How well this converter converts from `from_type` to `to_type`: a positive score when it
can, where a higher score wins; zero or less when it cannot (`GetAffinityForObjects`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/bindings/i_binding_fallback_converter.rs#L18)

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

### try_convert

```rust
fn try_convert(self: &Self, from_type: ConverterType, from: &dyn Any, to_type: ConverterType, conversion_hint: Option<&dyn Any>) -> Option<Rc<dyn Any>>
```

Converts `from`, a value of `from_type`, to a value of `to_type`, with an optional
`conversion_hint`; `None` when the conversion fails (`TryConvert`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/bindings/i_binding_fallback_converter.rs#L22)

## Availability

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