#[non_exhaustive]pub enum PatternError {
Empty,
Whitespace,
BareWildcard,
MisplacedWildcard,
MultiSegmentGlob,
EmptySuffix,
NoDot,
EmptyLabel,
LabelHyphenBorder {
label: String,
},
BadChar {
label: String,
},
}Expand description
Closed-enum classification of a single pattern’s rejection
reason. Used by validate_pattern and carried as the kind
field on InvalidPatternIssue. S3b’s doiget config doctor
surface branches on this for actionable per-error rendering.
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
Empty string.
Whitespace
Leading or trailing whitespace.
BareWildcard
Bare * with no leading-segment suffix.
MisplacedWildcard
* appearing anywhere other than the very first character
followed by ..
MultiSegmentGlob
Multi-segment glob (a second * after stripping *. prefix).
EmptySuffix
Nothing after the *. prefix (*. alone).
NoDot
No . in the host portion (single-label hostnames rejected).
EmptyLabel
A label is empty (consecutive .s or leading/trailing .).
LabelHyphenBorder
A label starts or ends with -.
BadChar
A label contains a character outside the allowed host charset.
Trait Implementations§
Source§impl Clone for PatternError
impl Clone for PatternError
Source§fn clone(&self) -> PatternError
fn clone(&self) -> PatternError
Returns a duplicate of the value. Read more
1.0.0 · 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 PatternError
impl Debug for PatternError
Source§impl Display for PatternError
impl Display for PatternError
Source§impl Error for PatternError
impl Error for PatternError
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 PatternError
impl PartialEq for PatternError
impl Eq for PatternError
impl StructuralPartialEq for PatternError
Auto Trait Implementations§
impl Freeze for PatternError
impl RefUnwindSafe for PatternError
impl Send for PatternError
impl Sync for PatternError
impl Unpin for PatternError
impl UnsafeUnpin for PatternError
impl UnwindSafe for PatternError
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