[][src]Struct tide::head::Path

pub struct Path<T>(pub T);

An extractor for path segments.

Routes can use wildcard path segments ({}), which are then extracted by the endpoint using this Path extractor. Each Path<T> argument to an extractor parses the next wildcard segment as type T, failing with a NOT_FOUND response if the segment fails to parse.

Examples

Extracting a path segment with:

use tide::head;

async fn path_segment(head::Path(s): head::Path<String>) -> String {
    println!("read segment: {}", s);
    s
}

fn main() {
    let mut app = tide::App::new(());
    app.at("/path/{}").get(path_segment);
    app.serve()
}

Trait Implementations

impl<T: Send + 'static + FromStr, S: 'static> Extract<S> for Path<T>
[src]

type Fut = Ready<Result<Self, Response>>

The async result of extract. Read more

impl<T> DerefMut for Path<T>
[src]

impl<T> Deref for Path<T>
[src]

type Target = T

The resulting type after dereferencing.

Auto Trait Implementations

impl<T> Send for Path<T> where
    T: Send

impl<T> Sync for Path<T> where
    T: Sync

Blanket Implementations

impl<T> From for T
[src]

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]