pub enum PressedKeyResult<R, PKS, KS> {
Pending(PKS),
NewPressedKey(NewPressedKey<R>),
Resolved(KS),
}
Expand description
Pressed Key which may be pending, or a resolved key state.
Variants§
Pending(PKS)
Unresolved key state. (e.g. tap-hold or chorded keys when first pressed).
NewPressedKey(NewPressedKey<R>)
Resolved as a new pressed key.
Resolved(KS)
Resolved key state.
Implementations§
Source§impl<R, PKS, KS> PressedKeyResult<R, PKS, KS>
impl<R, PKS, KS> PressedKeyResult<R, PKS, KS>
Sourcepub fn unwrap_resolved(self) -> KS
pub fn unwrap_resolved(self) -> KS
Returns the Resolved variant, or else panics.
Sourcepub fn map<TPKS, TKS>(
self,
f: fn(PKS) -> TPKS,
g: fn(KS) -> TKS,
) -> PressedKeyResult<R, TPKS, TKS>
pub fn map<TPKS, TKS>( self, f: fn(PKS) -> TPKS, g: fn(KS) -> TKS, ) -> PressedKeyResult<R, TPKS, TKS>
Maps the PressedKeyResult into a new type.
Trait Implementations§
Source§impl<R: PartialEq, PKS: PartialEq, KS: PartialEq> PartialEq for PressedKeyResult<R, PKS, KS>
impl<R: PartialEq, PKS: PartialEq, KS: PartialEq> PartialEq for PressedKeyResult<R, PKS, KS>
Source§fn eq(&self, other: &PressedKeyResult<R, PKS, KS>) -> bool
fn eq(&self, other: &PressedKeyResult<R, PKS, KS>) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl<R, PKS, KS> StructuralPartialEq for PressedKeyResult<R, PKS, KS>
Auto Trait Implementations§
impl<R, PKS, KS> Freeze for PressedKeyResult<R, PKS, KS>
impl<R, PKS, KS> RefUnwindSafe for PressedKeyResult<R, PKS, KS>
impl<R, PKS, KS> Send for PressedKeyResult<R, PKS, KS>
impl<R, PKS, KS> Sync for PressedKeyResult<R, PKS, KS>
impl<R, PKS, KS> Unpin for PressedKeyResult<R, PKS, KS>
impl<R, PKS, KS> UnwindSafe for PressedKeyResult<R, PKS, KS>
Blanket Implementations§
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