FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    SourceBindingMixins

    trait · ferroui-reactiveui · v0.5.0

    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. A registered IPropertyBindingHook may refuse a binding, which then binds nothing. Disposing the result disconnects the binding.

    View source

    Members

    bind_one_way

    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

    bind_one_way_select

    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

    bind_one_way_on

    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

    bind_one_way_select_on

    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

    bind_one_way_with

    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

    bind_two_way

    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

    bind_two_way_select

    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

    bind_two_way_on

    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

    bind_two_way_select_on

    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

    bind_two_way_with

    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

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.