pub trait Context: Clone + Copy {
type Event;
// Required method
fn handle_event(&mut self, event: Event<Self::Event>);
}
Expand description
Used to provide state that may affect behaviour when pressing the key.
e.g. the behaviour of layered::LayeredKey depends on which layers are active in layered::Context.
Required Associated Types§
Required Methods§
Sourcefn handle_event(&mut self, event: Event<Self::Event>)
fn handle_event(&mut self, event: Event<Self::Event>)
Used to update the Context’s state.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.