pub trait ConditionalEventHandler: Send + Sync {
// Required method
fn handle(
&self,
evt: &Event,
n: RepeatCount,
positive: bool,
ctx: &EventContext<'_>,
) -> Option<Cmd>;
}Expand description
May behave differently depending on:
- edit mode (emacs vs vi)
- vi input mode (insert vs replace vs command modes)
- empty line
- cursor position
- repeat count
- original key pressed (when same command is bound to different key)
- hint
- …
Required Methods§
Sourcefn handle(
&self,
evt: &Event,
n: RepeatCount,
positive: bool,
ctx: &EventContext<'_>,
) -> Option<Cmd>
fn handle( &self, evt: &Event, n: RepeatCount, positive: bool, ctx: &EventContext<'_>, ) -> Option<Cmd>
Takes the current input state and
returns the command to be performed or None to perform the default
one.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".