FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    PluginPropertyObservable

    struct · ferroui-reactiveui · v0.5.0

    struct PluginPropertyObservable<T: 'static>
    

    Observes one property through a registered property observer that outranks the mechanism the caller chose, reading the value with the caller's getter (PluginPropertyObservable<T>).

    The observer says when the property changed; the value is read with the getter, never from the notification. The current value is produced on subscription and again after each notification. An error or the completion of the observer's notifications is passed on after any value still waiting to be read.

    View source

    Members

    new

    fn new(plugin: Rc<dyn ICreatesObservableForProperty>, source: &PropertyOwner, property_name: impl Into<String>, getter: impl Fn() -> Option<T> + 'static, before_change: bool, distinct_until_changed: bool) -> Self
    where T: PartialEq
    

    The values of property_name of source, read with getter after each notification of plugin; with distinct_until_changed, a value equal to the last one is dropped.

    Source

    with_comparer

    fn with_comparer(plugin: Rc<dyn ICreatesObservableForProperty>, source: &PropertyOwner, property_name: impl Into<String>, getter: impl Fn() -> Option<T> + 'static, before_change: bool, comparer: Option<ValueComparer<T>>) -> Self
    

    new with the comparison of the distinct gate as a closure (None: no gate).

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • SubscribeGuard<T>
    • IObservable<T>

    Availability

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