smart_keymap::key

Trait Context

Source
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§

Source

type Event

The type of Event the context handles.

Required Methods§

Source

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.

Implementations on Foreign Types§

Source§

impl Context for ()

Source§

type Event = ()

Source§

fn handle_event(&mut self, _event: Event<Self::Event>)

Implementors§