pub enum PathPattern {
Literal(String),
Regex(RegexSegment),
Any,
AnyPath,
}Expand description
A single URL path-segment matcher.
Variants§
Literal(String)
A literal path segment, such as users.
Regex(RegexSegment)
A regex path segment, compiled and anchored to one segment.
Any
A wildcard matching exactly one path segment.
AnyPath
A catch-all wildcard matching the rest of the path.
Implementations§
Source§impl PathPattern
impl PathPattern
Sourcepub fn literal_path<T>(path: T) -> PathPattern
pub fn literal_path<T>(path: T) -> PathPattern
Creates a literal path pattern.
Sourcepub fn regex_path<T>(path: T) -> PathPattern
pub fn regex_path<T>(path: T) -> PathPattern
Creates a regex path pattern.
Sourcepub fn any() -> PathPattern
pub fn any() -> PathPattern
Creates a single-segment wildcard pattern.
Sourcepub fn any_path() -> PathPattern
pub fn any_path() -> PathPattern
Creates a catch-all wildcard pattern.
Sourcepub fn is_any_path(&self) -> bool
pub fn is_any_path(&self) -> bool
Returns whether this pattern is a catch-all wildcard.
Trait Implementations§
Source§impl Clone for PathPattern
impl Clone for PathPattern
Source§fn clone(&self) -> PathPattern
fn clone(&self) -> PathPattern
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 PathPattern
impl Debug for PathPattern
Source§impl Display for PathPattern
impl Display for PathPattern
Auto Trait Implementations§
impl Freeze for PathPattern
impl RefUnwindSafe for PathPattern
impl Send for PathPattern
impl Sync for PathPattern
impl Unpin for PathPattern
impl UnsafeUnpin for PathPattern
impl UnwindSafe for PathPattern
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> ParamValue for T
impl<T> ParamValue for T
Source§fn clone_box(&self) -> Box<dyn ParamValue>
fn clone_box(&self) -> Box<dyn ParamValue>
Clones this value and returns it as a boxed
ParamValue. Read moreSource§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Returns a reference to the underlying value as
Any. Read moreSource§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Returns a mutable reference to the underlying value as
Any. Read more