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.
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.
expression
fn expression(self: &Self) -> &Rc<dyn UntypedBindingExpression>
The expression behind the subject.
on_next
fn on_next(self: &Self, value: Option<BoxedValue>)
Writes a value to the binding source.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnySubscribeGuard<T>ErasedDestructorIntoEitherIObservable<Option<Rc<dyn AnyValue>>>
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.