pub enum ParseKeyError {
Empty,
EmptyComponent,
UnknownModifier(String),
UnknownKey(String),
InvalidFunctionKey(String),
}Expand description
Error produced when parsing a Key or KeyCode from a binding string.
Parsing is used by Key::matches, std::str::FromStr for Key, and
std::str::FromStr for KeyCode. The variants retain the offending
token where useful so configuration UIs can report actionable messages.
Variants§
Empty
Input was empty or whitespace-only.
EmptyComponent
A +-separated component was empty.
Examples include "ctrl++a", "ctrl+", and strings with a leading
separator such as "+a".
UnknownModifier(String)
A modifier token was not recognized.
The contained string is the exact modifier component that failed to parse, before any case normalization beyond comparison.
UnknownKey(String)
The terminal key token was not recognized.
The contained string is the key component after modifiers have been
split off. Single-character tokens are accepted as KeyCode::Char, so
this usually indicates an unknown named key.
InvalidFunctionKey(String)
A function-key token (f<n>) had an out-of-range index.
Valid function keys are f1 through f35, matching
KeyCode::FUNCTION_KEY_MAX.
Trait Implementations§
Source§impl Clone for ParseKeyError
impl Clone for ParseKeyError
Source§fn clone(&self) -> ParseKeyError
fn clone(&self) -> ParseKeyError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ParseKeyError
impl Debug for ParseKeyError
Source§impl Display for ParseKeyError
impl Display for ParseKeyError
Source§impl Error for ParseKeyError
impl Error for ParseKeyError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for ParseKeyError
impl PartialEq for ParseKeyError
Source§fn eq(&self, other: &ParseKeyError) -> bool
fn eq(&self, other: &ParseKeyError) -> bool
self and other values to be equal, and is used by ==.impl Eq for ParseKeyError
impl StructuralPartialEq for ParseKeyError
Auto Trait Implementations§
impl Freeze for ParseKeyError
impl RefUnwindSafe for ParseKeyError
impl Send for ParseKeyError
impl Sync for ParseKeyError
impl Unpin for ParseKeyError
impl UnsafeUnpin for ParseKeyError
impl UnwindSafe for ParseKeyError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string()] Read more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString]. Read more