pub struct EventDispatcher { /* private fields */ }Implementations§
Source§impl EventDispatcher
impl EventDispatcher
pub fn new() -> Self
Sourcepub fn add_handler(
&mut self,
node_id: NodeId,
kind: EventKind,
phase: EventPhase,
handler: HandlerFn,
)
pub fn add_handler( &mut self, node_id: NodeId, kind: EventKind, phase: EventPhase, handler: HandlerFn, )
Register a handler for a node + event kind + phase.
Sourcepub fn remove_handlers_for(&mut self, node_id: NodeId)
pub fn remove_handlers_for(&mut self, node_id: NodeId)
Remove all handlers for a node (called when node is removed from tree).
Sourcepub fn dispatch(
&mut self,
event: InputEvent,
layout: &LayoutEngine,
tree: &ShadowTree,
) -> EventResult
pub fn dispatch( &mut self, event: InputEvent, layout: &LayoutEngine, tree: &ShadowTree, ) -> EventResult
Dispatch an event through the tree.
Auto Trait Implementations§
impl Freeze for EventDispatcher
impl !RefUnwindSafe for EventDispatcher
impl Send for EventDispatcher
impl Sync for EventDispatcher
impl Unpin for EventDispatcher
impl UnsafeUnpin for EventDispatcher
impl !UnwindSafe for EventDispatcher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more