pub enum SlugError {
EmptyTransliterationPattern,
EmptyPathSegment,
PathSegmentSeparator {
character: char,
},
PathSegmentWhitespace {
character: char,
},
PathSegmentControlCharacter {
character: char,
},
PathSegmentDotValue,
UrlPathSegmentReservedCharacter {
character: char,
},
FallbackViolatesConfig {
reason: &'static str,
},
AmbiguousReplacementDelimiter {
delimiter: char,
reason: &'static str,
},
}Expand description
Errors returned by slug generation or validation.
Variants§
EmptyTransliterationPattern
A static transliteration map contains an empty pattern.
EmptyPathSegment
A path segment cannot be empty.
PathSegmentSeparator
A path segment cannot contain / or \.
PathSegmentWhitespace
A path segment cannot contain Unicode whitespace.
PathSegmentControlCharacter
A path segment cannot contain control characters.
PathSegmentDotValue
A path segment cannot be . or ...
UrlPathSegmentReservedCharacter
A URL path segment cannot contain URL delimiter or raw percent characters.
FallbackViolatesConfig
A EmptyOutputPolicy::UseFallbackSlug value does not satisfy the
configuration that produced the slug it replaces.
Either choose a fallback the configuration could itself have produced,
or say the value is exempt with
EmptyOutputPolicy::UseVerbatimFallbackSlug. That remedy is named
here rather than in the message, because the message is also read by
callers who reach this crate through something other than its Rust API
and have no such name to type.
AmbiguousReplacementDelimiter
The replacement delimiter is a character this configuration would also keep from the input, so the two could not be told apart.
Choose one the filter removes, such as - or _. Like the fallback
above, the remedy lives here and in each surface’s own diagnostics
rather than in the message every surface shares.
Trait Implementations§
impl Eq for SlugError
Source§impl Error for SlugError
impl Error for SlugError
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()