pub struct KeyBindings(/* private fields */);Expand description
Key assignments stored under [tui.key_bindings].
Each action accepts one or more key expressions. Missing action entries are filled with the defaults so older configuration files and partial overrides remain usable.
Implementations§
Source§impl KeyBindings
impl KeyBindings
Sourcepub fn keys(&self, action: KeyAction) -> &[String]
pub fn keys(&self, action: KeyAction) -> &[String]
Return the configured key expressions for an action.
Sourcepub fn set(&mut self, action: KeyAction, keys: Vec<String>)
pub fn set(&mut self, action: KeyAction, keys: Vec<String>)
Override one action. Validation is performed when the board configuration is loaded.
Sourcepub fn with_defaults(self) -> Self
pub fn with_defaults(self) -> Self
Fill omitted actions with their existing defaults.
Sourcepub fn validate(&self) -> Result<(), KeyBindingError>
pub fn validate(&self) -> Result<(), KeyBindingError>
Validate action names, non-empty assignments, and every key expression.
Trait Implementations§
Source§impl Clone for KeyBindings
impl Clone for KeyBindings
Source§fn clone(&self) -> KeyBindings
fn clone(&self) -> KeyBindings
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 KeyBindings
impl Debug for KeyBindings
Source§impl Default for KeyBindings
impl Default for KeyBindings
Source§impl<'de> Deserialize<'de> for KeyBindings
impl<'de> Deserialize<'de> for KeyBindings
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for KeyBindings
Source§impl PartialEq for KeyBindings
impl PartialEq for KeyBindings
Source§impl Serialize for KeyBindings
impl Serialize for KeyBindings
impl StructuralPartialEq for KeyBindings
Auto Trait Implementations§
impl Freeze for KeyBindings
impl RefUnwindSafe for KeyBindings
impl Send for KeyBindings
impl Sync for KeyBindings
impl Unpin for KeyBindings
impl UnsafeUnpin for KeyBindings
impl UnwindSafe for KeyBindings
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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