[−][src]Struct match_request::Params
Parameters matched by a URL pattern.
Implementations
impl Params
[src]
pub fn get<'a>(&'a self, name: &str) -> Option<&'a str>
[src]
Gets a named parameter from the matched pattern.
For example, the pattern /post/:id
would produce a named
parameter that can be retrieved using get("id")
.
pub fn tail(&self) -> Option<&str>
[src]
If the pattern included /*
, this is the rest of the path
from that point (including the leading forward-slash).
For example, the path /foo/bar
applied to the pattern
/foo/*
would result in a tail() value of Some("/bar")
). If
the pattern did not include /*
, this method returns None.
pub fn len(&self) -> usize
[src]
The total number of matched parameters (including the tail, if any).
pub fn is_empty(&self) -> bool
[src]
Returns true if the pattern matched no named parameters and no tail, false otherwise.
pub fn from_captures<'t>(names: CaptureNames, caps: Captures<'t>) -> Self
[src]
Creates a Params struct from the provided Regex capture names and matches (the tail capture should be named "__tail__").
You should not need to call this directly.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Params
impl Send for Params
impl Sync for Params
impl Unpin for Params
impl UnwindSafe for Params
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,