[][src]Struct match_request::Params

pub struct Params { /* fields omitted */ }

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

impl Clone for Params[src]

impl Debug for Params[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.