pub struct KeysConfig(pub BTreeMap<Action, Vec<String>>);Expand description
[keys] — which keys an action answers to, as the reader wrote them.
An action named here takes EXACTLY these keys, in every place it works:
its defaults are replaced, not extended, so [] unbinds it. An action not
named keeps its defaults.
The strings stay strings in this crate. What "ctrl-d" means, whether it
parses, and whether two actions now share a key are the renderer’s
questions, answered by one library call before a terminal is touched
(ADR 0036).
Tuple Fields§
§0: BTreeMap<Action, Vec<String>>Implementations§
Source§impl KeysConfig
impl KeysConfig
Sourcepub fn render_list(keys: &[String]) -> String
pub fn render_list(keys: &[String]) -> String
One action’s keys as [keys] writes them: ["ctrl-j", "d d"]. The
config modal shows and edits a row in exactly the file’s syntax, so
nothing a reader types there means something else in the file.
Sourcepub fn parse_list(text: &str) -> Result<Vec<String>, String>
pub fn parse_list(text: &str) -> Result<Vec<String>, String>
The inverse of render_list, with TOML’s own
error when the text is not a list of strings.
Trait Implementations§
Source§impl Clone for KeysConfig
impl Clone for KeysConfig
Source§impl Debug for KeysConfig
impl Debug for KeysConfig
Source§impl Default for KeysConfig
impl Default for KeysConfig
Source§impl<'de> Deserialize<'de> for KeysConfig
impl<'de> Deserialize<'de> for KeysConfig
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 KeysConfig
Source§impl PartialEq for KeysConfig
impl PartialEq for KeysConfig
Source§impl Serialize for KeysConfig
impl Serialize for KeysConfig
impl StructuralPartialEq for KeysConfig
Auto Trait Implementations§
impl Freeze for KeysConfig
impl RefUnwindSafe for KeysConfig
impl Send for KeysConfig
impl Sync for KeysConfig
impl Unpin for KeysConfig
impl UnsafeUnpin for KeysConfig
impl UnwindSafe for KeysConfig
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.