[][src]Struct tide::Route

pub struct Route<'a, State> { /* fields omitted */ }

A handle to a route.

All HTTP requests are made against resources. After using Server::at (or Route::at) to establish a route, the Route type can be used to establish endpoints for various HTTP methods at that path. Also, using nest, it can be used to set up a subrouter.

Methods

impl<'a, State: 'static> Route<'a, State>[src]

pub fn at<'b>(&'b mut self, path: &str) -> Route<'b, State>[src]

Extend the route with the given path.

pub fn nest(&mut self, f: impl FnOnce(&mut Route<'a, State>)) -> &mut Self[src]

pub fn method(&mut self, method: Method, ep: impl Endpoint<State>) -> &mut Self[src]

Add an endpoint for the given HTTP method

pub fn get(&mut self, ep: impl Endpoint<State>) -> &mut Self[src]

Add an endpoint for GET requests

pub fn head(&mut self, ep: impl Endpoint<State>) -> &mut Self[src]

Add an endpoint for HEAD requests

pub fn put(&mut self, ep: impl Endpoint<State>) -> &mut Self[src]

Add an endpoint for PUT requests

pub fn post(&mut self, ep: impl Endpoint<State>) -> &mut Self[src]

Add an endpoint for POST requests

pub fn delete(&mut self, ep: impl Endpoint<State>) -> &mut Self[src]

Add an endpoint for DELETE requests

pub fn options(&mut self, ep: impl Endpoint<State>) -> &mut Self[src]

Add an endpoint for OPTIONS requests

pub fn connect(&mut self, ep: impl Endpoint<State>) -> &mut Self[src]

Add an endpoint for CONNECT requests

pub fn patch(&mut self, ep: impl Endpoint<State>) -> &mut Self[src]

Add an endpoint for PATCH requests

pub fn trace(&mut self, ep: impl Endpoint<State>) -> &mut Self[src]

Add an endpoint for TRACE requests

Auto Trait Implementations

impl<'a, State> Send for Route<'a, State>

impl<'a, State> Sync for Route<'a, State>

impl<'a, State> Unpin for Route<'a, State>

impl<'a, State> !UnwindSafe for Route<'a, State>

impl<'a, State> !RefUnwindSafe for Route<'a, State>

Blanket Implementations

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

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

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

type Error = !

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.

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

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

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