pub enum SegmentError {
Empty,
ContainsSeparator(String),
ContainsWhitespace(String),
WildcardToken(String),
IllegalChar {
segment: String,
ch: char,
index: usize,
},
TooLong {
segment: String,
len: usize,
},
}Expand description
Why a candidate label is not a Segment.
Every arm names one rule from the module’s charset section, so a caller can report which rule the operator tripped rather than a generic “bad address”.
Variants§
Empty
The label was the empty string.
ContainsSeparator(String)
The label contained ., which would silently re-shape the tree.
ContainsWhitespace(String)
The label contained whitespace — invisible differences must never produce two distinct names.
WildcardToken(String)
The label was exactly * or >. Those are Pattern syntax
and can never be a literal label.
IllegalChar
The label held a character outside the accepted charset.
Fields
TooLong
The label was longer than SEGMENT_MAX_LEN.
Trait Implementations§
Source§impl Clone for SegmentError
impl Clone for SegmentError
Source§fn clone(&self) -> SegmentError
fn clone(&self) -> SegmentError
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 SegmentError
impl Debug for SegmentError
Source§impl Display for SegmentError
impl Display for SegmentError
impl Eq for SegmentError
Source§impl Error for SegmentError
impl Error for SegmentError
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 SegmentError
impl PartialEq for SegmentError
impl StructuralPartialEq for SegmentError
Auto Trait Implementations§
impl Freeze for SegmentError
impl RefUnwindSafe for SegmentError
impl Send for SegmentError
impl Sync for SegmentError
impl Unpin for SegmentError
impl UnsafeUnpin for SegmentError
impl UnwindSafe for SegmentError
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