# BindingTypeConverterDispatch

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

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

```rust
struct BindingTypeConverterDispatch
```

Runs a converter found at run time, typed or fallback, with the checks the bindings rely on
(`BindingTypeConverterDispatch`).

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

## Members

- [`try_convert`](#function-try_convert)
- [`try_convert_fallback`](#function-try_convert_fallback)
- [`try_convert_any`](#function-try_convert_any)

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

### try_convert

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

Converts `from` with a typed converter, when the converter's target type is `to_type` and
`from` is a value of its source type exactly; `None` otherwise or when the conversion fails
(`TryConvert(IBindingTypeConverter, ..)`).

A `None` input (upstream's `null`) goes to the converter, which decides.

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

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

### try_convert_fallback

```rust
fn try_convert_fallback(converter: &dyn IBindingFallbackConverter, from_type: ConverterType, from: &dyn Any, to_type: ConverterType, conversion_hint: Option<&dyn Any>) -> Option<Rc<dyn Any>>
```

Converts `from` with a fallback converter (`TryConvertFallback`).

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

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

### try_convert_any

```rust
fn try_convert_any(converter: Option<&ResolvedConverter>, from_type: ConverterType, from: Option<&dyn Any>, to_type: ConverterType, conversion_hint: Option<&dyn Any>) -> Option<Rc<dyn Any>>
```

Converts `from` with whatever `ConverterService::resolve_converter` found: a typed
converter goes through `try_convert`, a fallback converter through
`try_convert_fallback` and fails a `None` input; no converter
fails (`TryConvertAny`).



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

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`

## Availability

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