pub enum Capture<'a> {
DynParam(&'a str),
DynSegments(Vec<&'a str>),
}
Expand description
Represents a capture of an URL segment or segments.
Variants§
DynParam(&'a str)
A dynamic parameter in the URL (i.e. matches a single url segment).
DynSegments(Vec<&'a str>)
A dynamic segment in the URL (i.e. matches multiple url segments).
Implementations§
Source§impl<'a> Capture<'a>
impl<'a> Capture<'a>
Sourcepub fn as_dyn_param(&self) -> Option<&'a str>
pub fn as_dyn_param(&self) -> Option<&'a str>
Attempts to cast the Capture
to a Capture::DynParam
with the matched url param.
Sourcepub fn as_dyn_segments(&self) -> Option<&[&'a str]>
pub fn as_dyn_segments(&self) -> Option<&[&'a str]>
Attempts to cast the Capture
to a Capture::DynSegments
with the matched url params.
Trait Implementations§
impl<'a> Eq for Capture<'a>
impl<'a> StructuralPartialEq for Capture<'a>
Auto Trait Implementations§
impl<'a> Freeze for Capture<'a>
impl<'a> RefUnwindSafe for Capture<'a>
impl<'a> Send for Capture<'a>
impl<'a> Sync for Capture<'a>
impl<'a> Unpin for Capture<'a>
impl<'a> UnwindSafe for Capture<'a>
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