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.
Members
new
fn new<T: ?Sized>(e: &RoutedEvent<T>) -> Self
Creates a route for a routed event.
has_handlers
fn has_handlers(self: &Self) -> bool
Whether the route has any handlers.
add
fn add(self: &mut Self, target: &Ref<Interactive>, handler: RouteHandler, routes: RoutingStrategies, handled_events_too: bool)
Adds a handler to the route.
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.
raise_event
fn raise_event(self: &Self, source: &Ref<Interactive>, e: &dyn IRoutedEventArgs)
Raises an event along the route.
dispose
fn dispose(self: &mut Self)
Releases the route's handler list back to the pool.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEitherDrop
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.