# BindingTypeConverterRegistry

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

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

```rust
struct BindingTypeConverterRegistry
```

The typed converters, by the exact pair of their source and target types
(`BindingTypeConverterRegistry`). Of the converters of a pair, the one with the highest positive
affinity is the one used; on a tie the first registered wins.

A lookup reads a snapshot of the registrations, so a converter may register others while it is
asked for its affinity.

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

## Members

- [`new`](#function-new)
- [`register`](#function-register)
- [`try_get_converter`](#function-try_get_converter)
- [`get_all_converters`](#function-get_all_converters)

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

### new

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

An empty registry.

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

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

### register

```rust
fn register(self: &Self, converter: Rc<dyn IBindingTypeConverter>)
```

Registers `converter` under the pair of its source and target types (`Register`).

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

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

### try_get_converter

```rust
fn try_get_converter(self: &Self, from_type: ConverterType, to_type: ConverterType) -> Option<Rc<dyn IBindingTypeConverter>>
```

The converter of the highest positive affinity from `from_type` to `to_type`, or `None`
(`TryGetConverter`).

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

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

### get_all_converters

```rust
fn get_all_converters(self: &Self) -> Vec<Rc<dyn IBindingTypeConverter>>
```

Every registered converter, pair by pair in the order the pairs were first registered
(`GetAllConverters`).

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

## Trait implementations

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

## Availability

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