FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    Handler

    struct · ferroui-view · v0.5.0

    struct Handler
    

    A handler of an element. Its closure is in a cell that the attached trampoline reads, so that a component that runs again with handlers of the same identities in the same order swaps the closures into the cells of the attached handlers instead of detaching and attaching them.

    View source

    Members

    identity

    identity: usize
    

    What it handles: the address of the routed event or of the property; 0 for a handler that is attached again on every run.

    Source

    attach

    attach: Attach
    

    Attaches the trampoline of cell to a control.

    Source

    cell

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

    The closure: a RefCell<Rc<dyn Fn(..)>> of the type of the handler.

    Source

    swap

    swap: fn(&dyn Any, &dyn Any) -> ()
    

    Puts the closure of the second cell into the first (cells of this handler's type).

    Source

    attached_again

    fn attached_again(attach: Attach) -> Self
    

    A handler that is attached again on every run (no cell to swap).

    Source

    Trait implementations

    Availability

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