# SourceBindingMixins

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

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

```rust
trait SourceBindingMixins<S: 'static>
```

The bindings of a property of an object to a property of another
(`ReactiveUIBindingExtensions.BindOneWay`, `BindTwoWay`, and their forms of
`ReactiveSchedulerExtensions`); implemented for every `Rc<S>`.

The target property is written on the thread that owns the target (through the registered
`IViewThreadInvoker`), or on the scheduler the call names, and
only when it does not hold the value already. A two-way binding seeds the target from the
source, then mirrors each later change of either side; the target's own value at the start is
not written back. The conversions are those of [`PropertyBindingMixins`](/docs/0.5.0/api/ferroui-reactiveui/binding/mixins/trait-propertybindingmixins/). A registered
`IPropertyBindingHook` may refuse a binding, which then binds
nothing. Disposing the result disconnects the binding.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/mixins/reactive_ui_binding_extensions_binding.rs#L354)

## Members

- [`bind_one_way`](#function-bind_one_way)
- [`bind_one_way_select`](#function-bind_one_way_select)
- [`bind_one_way_on`](#function-bind_one_way_on)
- [`bind_one_way_select_on`](#function-bind_one_way_select_on)
- [`bind_one_way_with`](#function-bind_one_way_with)
- [`bind_two_way`](#function-bind_two_way)
- [`bind_two_way_select`](#function-bind_two_way_select)
- [`bind_two_way_on`](#function-bind_two_way_on)
- [`bind_two_way_select_on`](#function-bind_two_way_select_on)
- [`bind_two_way_with`](#function-bind_two_way_with)

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

### bind_one_way

```rust
fn bind_one_way<T, TS, TT>(self: &Self, target: &Rc<T>, source_property: PropertyPath<Rc<S>, TS>, target_property: SettableProperty<Rc<T>, TT>) -> Rc<dyn IDisposable>
where T: 'static,
      TS: Clone + PartialEq + 'static,
      TT: Clone + PartialEq + 'static
```

Binds `source_property` one way to `target_property` of `target`
(`BindOneWay(TTarget, Expression, Expression)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/mixins/reactive_ui_binding_extensions_binding.rs#L361)

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

### bind_one_way_select

```rust
fn bind_one_way_select<T, TS, TT>(self: &Self, target: &Rc<T>, source_property: PropertyPath<Rc<S>, TS>, target_property: SettableProperty<Rc<T>, TT>, conversion: impl Fn(TS) -> TT + 'static) -> Rc<dyn IDisposable>
where T: 'static,
      TS: Clone + PartialEq + 'static,
      TT: Clone + PartialEq + 'static
```

`bind_one_way` through `conversion`
(`BindOneWay(TTarget, Expression, Expression, Func<TSourceProp, TTargetProp>)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/mixins/reactive_ui_binding_extensions_binding.rs#L372)

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

### bind_one_way_on

```rust
fn bind_one_way_on<T, TS, TT>(self: &Self, target: &Rc<T>, source_property: PropertyPath<Rc<S>, TS>, target_property: SettableProperty<Rc<T>, TT>, scheduler: Option<Rc<dyn IScheduler>>) -> Rc<dyn IDisposable>
where T: 'static,
      TS: Clone + PartialEq + 'static,
      TT: Clone + PartialEq + 'static
```

`bind_one_way`, writing on `scheduler`, or on the target's thread
when it is `None` (`ReactiveSchedulerExtensions.BindOneWay(..., ISequencer?)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/mixins/reactive_ui_binding_extensions_binding.rs#L389)

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

### bind_one_way_select_on

```rust
fn bind_one_way_select_on<T, TS, TT>(self: &Self, target: &Rc<T>, source_property: PropertyPath<Rc<S>, TS>, target_property: SettableProperty<Rc<T>, TT>, conversion: impl Fn(TS) -> TT + 'static, scheduler: Option<Rc<dyn IScheduler>>) -> Rc<dyn IDisposable>
where T: 'static,
      TS: Clone + PartialEq + 'static,
      TT: Clone + PartialEq + 'static
```

`bind_one_way_select`, writing on `scheduler`, or on the
target's thread when it is `None` (`ReactiveSchedulerExtensions.BindOneWay(..., Func,
ISequencer?)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/mixins/reactive_ui_binding_extensions_binding.rs#L407)

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

### bind_one_way_with

```rust
fn bind_one_way_with<T, TS, TT>(self: &Self, target: &Rc<T>, source_property: PropertyPath<Rc<S>, TS>, target_property: SettableProperty<Rc<T>, TT>, converter: Option<Rc<dyn IBindingTypeConverter>>, conversion_hint: Option<Rc<dyn Any>>, scheduler: Option<Rc<dyn IScheduler>>) -> Rc<dyn IDisposable>
where T: 'static,
      TS: Clone + PartialEq + 'static,
      TT: Clone + PartialEq + 'static
```

`bind_one_way`, converting with `converter` instead of a registered
converter when it is given, with `conversion_hint`, and writing on `scheduler`, or on the
target's thread when it is `None` (`ReactiveSchedulerExtensions.BindOneWay(...,
IBindingTypeConverter, object?, ISequencer?)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/mixins/reactive_ui_binding_extensions_binding.rs#L427)

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

### bind_two_way

```rust
fn bind_two_way<T, TS, TT>(self: &Self, target: &Rc<T>, source_property: SettableProperty<Rc<S>, TS>, target_property: SettableProperty<Rc<T>, TT>) -> Rc<dyn IDisposable>
where T: 'static,
      TS: Clone + PartialEq + 'static,
      TT: Clone + PartialEq + 'static
```

Binds `source_property` and `target_property` of `target` to each other
(`BindTwoWay(TTarget, Expression, Expression)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/mixins/reactive_ui_binding_extensions_binding.rs#L453)

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

### bind_two_way_select

```rust
fn bind_two_way_select<T, TS, TT>(self: &Self, target: &Rc<T>, source_property: SettableProperty<Rc<S>, TS>, target_property: SettableProperty<Rc<T>, TT>, source_to_target: impl Fn(TS) -> TT + 'static, target_to_source: impl Fn(TT) -> TS + 'static) -> Rc<dyn IDisposable>
where T: 'static,
      TS: Clone + PartialEq + 'static,
      TT: Clone + PartialEq + 'static
```

`bind_two_way` through `source_to_target` and `target_to_source`
(`BindTwoWay(TTarget, Expression, Expression, Func, Func)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/mixins/reactive_ui_binding_extensions_binding.rs#L472)

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

### bind_two_way_on

```rust
fn bind_two_way_on<T, TS, TT>(self: &Self, target: &Rc<T>, source_property: SettableProperty<Rc<S>, TS>, target_property: SettableProperty<Rc<T>, TT>, scheduler: Option<Rc<dyn IScheduler>>) -> Rc<dyn IDisposable>
where T: 'static,
      TS: Clone + PartialEq + 'static,
      TT: Clone + PartialEq + 'static
```

`bind_two_way`, writing to the target on `scheduler`, or on the
target's thread when it is `None`; on a scheduler, only the latest value that waits is
written (`ReactiveSchedulerExtensions.BindTwoWay(..., ISequencer?)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/mixins/reactive_ui_binding_extensions_binding.rs#L499)

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

### bind_two_way_select_on

```rust
fn bind_two_way_select_on<T, TS, TT>(self: &Self, target: &Rc<T>, source_property: SettableProperty<Rc<S>, TS>, target_property: SettableProperty<Rc<T>, TT>, source_to_target: impl Fn(TS) -> TT + 'static, target_to_source: impl Fn(TT) -> TS + 'static, scheduler: Option<Rc<dyn IScheduler>>) -> Rc<dyn IDisposable>
where T: 'static,
      TS: Clone + PartialEq + 'static,
      TT: Clone + PartialEq + 'static
```

`bind_two_way_select`, writing to the target on `scheduler`,
or on the target's thread when it is `None` (`ReactiveSchedulerExtensions.BindTwoWay(...,
Func, Func, ISequencer?)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/mixins/reactive_ui_binding_extensions_binding.rs#L525)

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

### bind_two_way_with

```rust
fn bind_two_way_with<T, TS, TT>(self: &Self, target: &Rc<T>, source_property: SettableProperty<Rc<S>, TS>, target_property: SettableProperty<Rc<T>, TT>, source_to_target_converter: Option<Rc<dyn IBindingTypeConverter>>, target_to_source_converter: Option<Rc<dyn IBindingTypeConverter>>, conversion_hint: Option<Rc<dyn Any>>, scheduler: Option<Rc<dyn IScheduler>>) -> Rc<dyn IDisposable>
where T: 'static,
      TS: Clone + PartialEq + 'static,
      TT: Clone + PartialEq + 'static
```

`bind_two_way`, converting with `source_to_target_converter` and
`target_to_source_converter` instead of the registered converters when they are given, with
`conversion_hint`, and writing to the target on `scheduler`, or on the target's thread when
it is `None` (`ReactiveSchedulerExtensions.BindTwoWay(..., IBindingTypeConverter,
IBindingTypeConverter, object?, ISequencer?)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI/binding/mixins/reactive_ui_binding_extensions_binding.rs#L556)

## Trait implementations

- [`SourceBindingMixins<S>`](/docs/0.5.0/api/ferroui-reactiveui/binding/mixins/trait-sourcebindingmixins/)

## Availability

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