Enum diff_tool::inputs::key::Key

source ·
pub enum Key {
Show 31 variants Enter, Tab, Backspace, Esc, Left, Right, Up, Down, Ins, Delete, Home, End, PageUp, PageDown, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, Char(char), Ctrl(char), Alt(char), Unknown,
}

Variants§

§

Enter

Both Enter (or Return) and numpad Enter

§

Tab

Tabulation key

§

Backspace

Backspace key

§

Esc

Escape key

§

Left

Left arrow

§

Right

Right arrow

§

Up

Up arrow

§

Down

Down arrow

§

Ins

Insert key

§

Delete

Delete key

§

Home

Home key

§

End

End key

§

PageUp

Page Up key

§

PageDown

Page Down key

§

F0

F0 key

§

F1

F1 key

§

F2

F2 key

§

F3

F3 key

§

F4

F4 key

§

F5

F5 key

§

F6

F6 key

§

F7

F7 key

§

F8

F8 key

§

F9

F9 key

§

F10

F10 key

§

F11

F11 key

§

F12

F12 key

§

Char(char)

§

Ctrl(char)

§

Alt(char)

§

Unknown

Implementations§

source§

impl Key

source

pub fn is_exit(&self) -> bool

If exit

source

pub fn from_f(n: u8) -> Key

Returns the function key corresponding to the given number

1 -> F1, etc…

Panics

If n == 0 || n > 12

Trait Implementations§

source§

impl Clone for Key

source§

fn clone(&self) -> Key

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Key

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Key

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<KeyEvent> for Key

source§

fn from(key_event: KeyEvent) -> Self

Converts to this type from the input type.
source§

impl Hash for Key

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Key

source§

fn eq(&self, other: &Key) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Key

source§

impl Eq for Key

source§

impl StructuralEq for Key

source§

impl StructuralPartialEq for Key

Auto Trait Implementations§

§

impl RefUnwindSafe for Key

§

impl Send for Key

§

impl Sync for Key

§

impl Unpin for Key

§

impl UnwindSafe for Key

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.