pub struct Chord(/* private fields */);Expand description
One to Chord::MAX_LEN combos pressed in sequence (g g, Ctrl+x Ctrl+s).
Implementations§
Source§impl Chord
impl Chord
Sourcepub fn new(combos: Vec<KeyCombo>) -> Result<Self, KeyParseError>
pub fn new(combos: Vec<KeyCombo>) -> Result<Self, KeyParseError>
Build a chord from combos (1..=Chord::MAX_LEN).
Sourcepub fn parse(s: &str) -> Result<Self, KeyParseError>
pub fn parse(s: &str) -> Result<Self, KeyParseError>
Parse a whitespace-separated chord such as "g g" or "Ctrl+x Ctrl+s".
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Never true for a chord built through the constructors; provided for API completeness.
Sourcepub fn is_prefix_of(&self, other: &Self) -> bool
pub fn is_prefix_of(&self, other: &Self) -> bool
Whether this chord is a strict prefix of other (g of g g).
Trait Implementations§
impl Eq for Chord
impl StructuralPartialEq for Chord
Auto Trait Implementations§
impl Freeze for Chord
impl RefUnwindSafe for Chord
impl Send for Chord
impl Sync for Chord
impl Unpin for Chord
impl UnsafeUnpin for Chord
impl UnwindSafe for Chord
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