FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    EventRoute

    struct · ferroui-base · v0.5.0

    struct EventRoute
    

    Holds the route for a routed event and supports raising an event on that route.

    The list of handlers is taken from a per-thread pool and returned to it when the route is dropped (or disposed), so raising an event does not allocate once the pool is warm.

    View source

    Members

    new

    fn new<T: ?Sized>(e: &RoutedEvent<T>) -> Self
    

    Creates a route for a routed event.

    Source

    has_handlers

    fn has_handlers(self: &Self) -> bool
    

    Whether the route has any handlers.

    Source

    add

    fn add(self: &mut Self, target: &Ref<Interactive>, handler: RouteHandler, routes: RoutingStrategies, handled_events_too: bool)
    

    Adds a handler to the route.

    Source

    add_class_handler

    fn add_class_handler(self: &mut Self, target: &Ref<Interactive>)
    

    Adds a class handler to the route: a marker that makes the class handlers of the event run for target.

    Source

    raise_event

    fn raise_event(self: &Self, source: &Ref<Interactive>, e: &dyn IRoutedEventArgs)
    

    Raises an event along the route.

    Source

    dispose

    fn dispose(self: &mut Self)
    

    Releases the route's handler list back to the pool.

    Source

    Trait implementations

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

    Availability

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