pub trait Button: Widget {
// Required methods
fn accel(&self) -> char;
fn result(&self) -> ButtonResult;
// Provided methods
fn pressed(&mut self) { ... }
fn state(&self) -> bool { ... }
}Expand description
Trait used when designing new buttons. All buttons implement some key that is recorded, and returns some result that can be matched to run some action
Required Methods§
Sourcefn result(&self) -> ButtonResult
fn result(&self) -> ButtonResult
Return the ButtonResult which would be returned if the
key is detected
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".