FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    BindingChange

    struct · ferroui-reactiveui · v0.5.0

    struct BindingChange
    

    A value a two-way binding moved, and which side of the binding produced it (BindingChange).

    A two-way binding's change stream carries both directions, so a subscriber that acted on every value without knowing where it came from would act twice on its own write. The flag is what separates an edit from the echo of one.

    The value is type-erased, as upstream's object? Value: a change from the view model carries the value written to the view, a change from the view the value written to the view model, and the two may differ in type. value_as reads it back.

    View source

    Members

    value

    value: std::rc::Rc<dyn Any>
    

    The value that was written (Value).

    Source

    from_view_model

    from_view_model: bool
    

    Whether the view model produced the value, rather than the view (FromViewModel).

    Source

    new

    fn new<T: 'static>(value: T, from_view_model: bool) -> Self
    

    A change of value, produced by the view model when from_view_model is true.

    Source

    value_as

    fn value_as<T: 'static>(self: &Self) -> Option<&T>
    

    The value, when it is a T.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • Clone
    • Debug
    • IObservable<BindingChange>

    Availability

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