Enum r3bl_rs_utils::InputEvent
source · #[non_exhaustive]
pub enum InputEvent {
Keyboard(KeyPress),
Resize(Size),
Mouse(MouseInput),
Focus(FocusEvent),
Paste(String),
}
Expand description
Please see KeyPress for more information about handling keyboard input.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Keyboard(KeyPress)
Resize(Size)
Mouse(MouseInput)
Focus(FocusEvent)
Paste(String)
A string that was pasted into the terminal. Only emitted if bracketed-paste
feature has
been enabled for crossterm in Cargo.toml.
Implementations§
source§impl InputEvent
impl InputEvent
pub fn matches_keypress(&self, other: KeyPress) -> bool
pub fn matches_any_of_these_keypresses(&self, others: &[KeyPress]) -> bool
source§impl InputEvent
impl InputEvent
sourcepub fn matches(&self, exit_keys: &[InputEvent]) -> bool
pub fn matches(&self, exit_keys: &[InputEvent]) -> bool
Checks to see whether the input_event
matches any of the exit_keys
. Returns true
if it does and false
otherwise.
Trait Implementations§
source§impl Clone for InputEvent
impl Clone for InputEvent
source§fn clone(&self) -> InputEvent
fn clone(&self) -> InputEvent
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for InputEvent
impl Debug for InputEvent
source§impl<'de> Deserialize<'de> for InputEvent
impl<'de> Deserialize<'de> for InputEvent
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<InputEvent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<InputEvent, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for InputEvent
impl Display for InputEvent
source§impl From<(u16, u16)> for InputEvent
impl From<(u16, u16)> for InputEvent
source§fn from(size: (u16, u16)) -> InputEvent
fn from(size: (u16, u16)) -> InputEvent
Typecast / convert [(u16, u16)] to InputEvent::Resize.
source§impl From<MouseEvent> for InputEvent
impl From<MouseEvent> for InputEvent
source§fn from(mouse_event: MouseEvent) -> InputEvent
fn from(mouse_event: MouseEvent) -> InputEvent
Typecast / convert MouseEvent to InputEvent::Mouse.
source§impl PartialEq<InputEvent> for InputEvent
impl PartialEq<InputEvent> for InputEvent
source§fn eq(&self, other: &InputEvent) -> bool
fn eq(&self, other: &InputEvent) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for InputEvent
impl Serialize for InputEvent
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
source§impl TryFrom<&InputEvent> for EditorEvent
impl TryFrom<&InputEvent> for EditorEvent
source§fn try_from(
input_event: &InputEvent
) -> Result<EditorEvent, <EditorEvent as TryFrom<&InputEvent>>::Error>
fn try_from( input_event: &InputEvent ) -> Result<EditorEvent, <EditorEvent as TryFrom<&InputEvent>>::Error>
Performs the conversion.
source§impl TryFrom<Event> for InputEvent
impl TryFrom<Event> for InputEvent
source§fn try_from(
event: Event
) -> Result<InputEvent, <InputEvent as TryFrom<Event>>::Error>
fn try_from( event: Event ) -> Result<InputEvent, <InputEvent as TryFrom<Event>>::Error>
Typecast / convert Event to InputEvent.
source§impl TryFrom<KeyEvent> for InputEvent
impl TryFrom<KeyEvent> for InputEvent
impl Eq for InputEvent
impl StructuralEq for InputEvent
impl StructuralPartialEq for InputEvent
Auto Trait Implementations§
impl RefUnwindSafe for InputEvent
impl Send for InputEvent
impl Sync for InputEvent
impl Unpin for InputEvent
impl UnwindSafe for InputEvent
Blanket Implementations§
source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere T: FloatComponent, Swp: WhitePoint, Dwp: WhitePoint, D: AdaptFrom<S, Swp, Dwp, T>,
source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere M: TransformMatrix<Swp, Dwp, T>,
Convert the source color to the destination color using the specified
method
source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford
method by default
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere U: FromColor<T>,
source§fn into_color(self) -> U
fn into_color(self) -> U
Convert into T with values clamped to the color defined bounds Read more
source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere U: FromColorUnclamped<T>,
source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Convert into T. The resulting color might be invalid in its color space Read more
source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere U: TryFromColor<T>,
source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
Convert into T, returning ok if the color is inside of its defined
range, otherwise an
OutOfBounds
error is returned which contains
the unclamped color. Read more