# ISetMethodBindingConverter

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

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

```rust
trait ISetMethodBindingConverter
```

Sets a value on a binding target in a way of its own, such as filling a collection instead of
replacing it (`ISetMethodBindingConverter`).
`SetMethodBindingConverterRegistry` picks the one
with the highest affinity for a pair of types.

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

## Members

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

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

### get_affinity_for_objects

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

How well this converter sets a value of `from_type` on a target of `to_type`: a positive
score when it can, where a higher score wins; zero or less when it cannot. Either type may
be unknown (`GetAffinityForObjects`).

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

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

### perform_set

```rust
fn perform_set(self: &Self, to_target: Option<Rc<dyn Any>>, new_value: Option<Rc<dyn Any>>, arguments: Option<&[Option<Rc<dyn Any>>]>) -> Option<Rc<dyn Any>>
```

Sets `new_value` on `to_target`, with the `arguments` of an indexer if there are any, and
returns the value the target property holds afterwards (`PerformSet`).

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

## Availability

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