pub trait Component {
// Required method
fn layout(&self) -> &Layout;
// Provided methods
fn update(&mut self) { ... }
fn on_mouse_down(&mut self) { ... }
fn on_mouse_up(&mut self) { ... }
fn on_key_down(&mut self, key: Key) { ... }
fn on_key_up(&mut self) { ... }
fn on_right_mouse_down(&mut self) { ... }
fn on_right_mouse_up(&mut self) { ... }
}Required Methods§
Provided Methods§
fn update(&mut self)
fn on_mouse_down(&mut self)
fn on_mouse_up(&mut self)
fn on_key_down(&mut self, key: Key)
fn on_key_up(&mut self)
fn on_right_mouse_down(&mut self)
fn on_right_mouse_up(&mut self)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".