FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    EventPatternSourceBase

    struct · ferroui-reactive · v0.5.0

    struct EventPatternSourceBase<S, A>
    

    The base of an event that notifies the event patterns of a sequence (EventPatternSourceBase<TSender, TEventArgs>): each handler added subscribes to the sequence, and invoke_handler hands it each pattern; the handler leaves when the sequence ends, and an error of the sequence panics after it has left (upstream rethrows the error).

    View source

    Members

    new

    fn new(source: Rc<dyn IObservable<EventPattern<S, A>>>, invoke_handler: impl Fn(&dyn Fn(S, A) -> (), EventPattern<S, A>) -> () + 'static) -> Self
    

    The event of the patterns of source, which invoke_handler hands to a handler (EventPatternSourceBase(IObservable<EventPattern<TSender, TEventArgs>>, Action<Action<TSender, TEventArgs>, EventPattern<TSender, TEventArgs>>)).

    Source

    add

    fn add(self: &Self, invoke: Rc<dyn Fn(S, A) -> ()>) -> u64
    

    Adds a handler, invoke (Add(Delegate, Action<TSender, TEventArgs>)), subscribed to the sequence; returns the token that removes it.

    Source

    remove

    fn remove(self: &Self, token: u64) -> bool
    

    Removes the handler of token and disposes its subscription (Remove(Delegate)). False when the token is unknown.

    Source

    Trait implementations

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

    Availability

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