pub enum ParseRuleIdError {
MissingNamespace(String),
TooManySeparators(String),
InvalidNamespace {
name: String,
id: String,
reason: &'static str,
},
EmptyName(String),
InvalidName {
name: String,
id: String,
reason: &'static str,
},
}Expand description
Why a string is not a valid rule ID.
Each variant carries what was actually seen. A diagnostic that says only “invalid rule ID” makes the reader diff two strings by eye.
Variants§
MissingNamespace(String)
No / separating namespace from name.
TooManySeparators(String)
More than one /.
InvalidNamespace
The namespace is not spelled like a namespace.
Fields
EmptyName(String)
Nothing after the separator.
InvalidName
The name violates the naming rules.
Trait Implementations§
Source§impl Clone for ParseRuleIdError
impl Clone for ParseRuleIdError
Source§fn clone(&self) -> ParseRuleIdError
fn clone(&self) -> ParseRuleIdError
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 ParseRuleIdError
impl Debug for ParseRuleIdError
Source§impl Display for ParseRuleIdError
impl Display for ParseRuleIdError
impl Eq for ParseRuleIdError
Source§impl Error for ParseRuleIdError
impl Error for ParseRuleIdError
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 ParseRuleIdError
impl PartialEq for ParseRuleIdError
impl StructuralPartialEq for ParseRuleIdError
Auto Trait Implementations§
impl Freeze for ParseRuleIdError
impl RefUnwindSafe for ParseRuleIdError
impl Send for ParseRuleIdError
impl Sync for ParseRuleIdError
impl Unpin for ParseRuleIdError
impl UnsafeUnpin for ParseRuleIdError
impl UnwindSafe for ParseRuleIdError
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