#[non_exhaustive]pub enum InvalidPathTemplate {
MissingLeadingSlash(String),
UnbalancedBraces(String),
EmptyExpression(String),
DuplicateVariable {
template: String,
name: String,
},
NotAPath(String),
IllegalLiteralCharacter {
template: String,
character: char,
},
MalformedPercentEncoding(String),
EmptySegment(String),
}Expand description
The error returned when a path template is malformed.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MissingLeadingSlash(String)
The template did not begin with /.
UnbalancedBraces(String)
A { was opened but never closed, or a } appeared unopened.
EmptyExpression(String)
A {} expression contained no name.
DuplicateVariable
The same variable name appeared more than once.
A template expression must not be repeated within one path.
Fields
NotAPath(String)
The template contained a query string or fragment.
IllegalLiteralCharacter
A literal segment contained a character the path grammar forbids.
Outside a {} expression a template may only carry pchar: letters,
digits, -._~, the sub-delimiters !$&'()*+,;=, :, @, and
percent-encoded triples. Anything else — including any non-ASCII
character — has to arrive percent-encoded.
Fields
MalformedPercentEncoding(String)
A % was not followed by two hexadecimal digits.
EmptySegment(String)
Two / met with nothing between them.
A path segment always holds at least one character. A trailing / is
legal, because the grammar makes the final segment optional.
Trait Implementations§
Source§impl Clone for InvalidPathTemplate
impl Clone for InvalidPathTemplate
Source§fn clone(&self) -> InvalidPathTemplate
fn clone(&self) -> InvalidPathTemplate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InvalidPathTemplate
impl Debug for InvalidPathTemplate
Source§impl Display for InvalidPathTemplate
impl Display for InvalidPathTemplate
impl Eq for InvalidPathTemplate
Source§impl Error for InvalidPathTemplate
impl Error for InvalidPathTemplate
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()
Source§impl PartialEq for InvalidPathTemplate
impl PartialEq for InvalidPathTemplate
impl StructuralPartialEq for InvalidPathTemplate
Auto Trait Implementations§
impl Freeze for InvalidPathTemplate
impl RefUnwindSafe for InvalidPathTemplate
impl Send for InvalidPathTemplate
impl Sync for InvalidPathTemplate
impl Unpin for InvalidPathTemplate
impl UnsafeUnpin for InvalidPathTemplate
impl UnwindSafe for InvalidPathTemplate
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.