pub trait PointerInputHandler: Any {
// Required methods
fn clone_handler(&self) -> Box<dyn PointerInputHandler>;
fn on_event(&mut self, event: &PointerEvent) -> bool;
// Provided methods
fn sync(&mut self, next: &dyn PointerInputHandler) { ... }
fn on_attach(&mut self) { ... }
fn on_detach(&mut self) { ... }
}Expand description
Receives the pointer events of one hit region.
on_event returns true when it handled the event; that consumes it so
ancestors in the main pass do not also react.
Required Methods§
Sourcefn clone_handler(&self) -> Box<dyn PointerInputHandler>
fn clone_handler(&self) -> Box<dyn PointerInputHandler>
Build a fresh handler with the same configuration and no runtime state.
fn on_event(&mut self, event: &PointerEvent) -> bool
Provided Methods§
Sourcefn sync(&mut self, next: &dyn PointerInputHandler)
fn sync(&mut self, next: &dyn PointerInputHandler)
Copy configuration from a freshly built handler into this one, leaving runtime state (press position, accumulated drag) alone.
fn on_attach(&mut self)
fn on_detach(&mut self)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".