pub struct ChordState {
pub current_chord: Vec<String>,
pub chord_start: Option<SystemTime>,
pub is_active: bool,
pub description: Option<String>,
pub registered_chords: HashMap<String, String>,
pub history: Vec<(String, String, SystemTime)>,
}
Expand description
State for managing key chord sequences
Fields§
§current_chord: Vec<String>
Current chord sequence being built
chord_start: Option<SystemTime>
Time when current chord started (as timestamp)
is_active: bool
Whether chord mode is active
description: Option<String>
Description of current chord mode (e.g., “Yank mode”)
registered_chords: HashMap<String, String>
Registered chord mappings (chord -> action)
history: Vec<(String, String, SystemTime)>
History of chord completions
Implementations§
Source§impl ChordState
impl ChordState
Sourcepub fn get_chord_string(&self) -> String
pub fn get_chord_string(&self) -> String
Get the current chord as a string
Sourcepub fn check_match(&self) -> Option<String>
pub fn check_match(&self) -> Option<String>
Check if current chord matches a registered chord
Sourcepub fn is_partial_match(&self) -> bool
pub fn is_partial_match(&self) -> bool
Check if current chord is a partial match
Sourcepub fn record_completion(&mut self, chord: String, action: String)
pub fn record_completion(&mut self, chord: String, action: String)
Record a completed chord
Trait Implementations§
Source§impl Clone for ChordState
impl Clone for ChordState
Source§fn clone(&self) -> ChordState
fn clone(&self) -> ChordState
Returns a duplicate 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 ChordState
impl Debug for ChordState
Auto Trait Implementations§
impl Freeze for ChordState
impl RefUnwindSafe for ChordState
impl Send for ChordState
impl Sync for ChordState
impl Unpin for ChordState
impl UnwindSafe for ChordState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more