#[non_exhaustive]pub enum KeywordError {
Empty,
InvalidChar(char),
ReservedPrefix,
}Expand description
Error returned by Keyword::try_new when the input violates RFC 8621 §4.1.1.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Empty
The keyword string is empty.
InvalidChar(char)
The keyword contains a character outside the allowed set (RFC 8621 §4.1.1: visible ASCII, no whitespace).
ReservedPrefix
The keyword starts with $ but is not one of the IANA-registered system keywords.
Custom keywords MUST NOT begin with $ (RFC 8621 §4.1.1).
Trait Implementations§
Source§impl Clone for KeywordError
impl Clone for KeywordError
Source§impl Debug for KeywordError
impl Debug for KeywordError
Source§impl Display for KeywordError
impl Display for KeywordError
impl Eq for KeywordError
Source§impl Error for KeywordError
impl Error for KeywordError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for KeywordError
impl PartialEq for KeywordError
impl StructuralPartialEq for KeywordError
Auto Trait Implementations§
impl Freeze for KeywordError
impl RefUnwindSafe for KeywordError
impl Send for KeywordError
impl Sync for KeywordError
impl Unpin for KeywordError
impl UnsafeUnpin for KeywordError
impl UnwindSafe for KeywordError
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