Skip to main content

AsKeystroke

Trait AsKeystroke 

Source
pub trait AsKeystroke {
    // Required method
    fn as_keystroke(&self) -> &Keystroke;
}
Expand description

A type that can be viewed as a Keystroke.

Matching code uses this so that it accepts both a Keystroke that was typed and a KeybindingKeystroke from a keymap.

Required Methods§

Source

fn as_keystroke(&self) -> &Keystroke

Returns the Keystroke this value represents.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: AsKeystroke + ?Sized> AsKeystroke for &T

Implementors§