FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ObservableSink

    struct · ferroui-base · v0.5.0

    struct ObservableSink
    

    Adapts a binding expression to an observable subject: observers receive the values of the expression, and values pushed into the subject are written to the binding source.

    This preserves the semantics of binding expressions as observed through an observable (mostly for unit tests), not necessarily those of an expression instantiated on an object. An expression may act either as an observable or as a binding on an object, not both.

    View source

    Members

    create

    fn create<E: UntypedBindingExpression>(expression: &Rc<E>, target: Option<&FerroObject>) -> Rc<ObservableSink>
    

    Produces an observable which can be used to observe the value of expression. Panics if the expression is already instantiated on an object.

    Source

    expression

    fn expression(self: &Self) -> &Rc<dyn UntypedBindingExpression>
    

    The expression behind the subject.

    Source

    on_next

    fn on_next(self: &Self, value: Option<BoxedValue>)
    

    Writes a value to the binding source.

    Source

    Trait implementations

    Availability

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