[−][src]Struct tide::Route
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 strip_prefix(&mut self) -> &mut Self
[src]
unstable
only.Treat the current path as a prefix, and strip prefixes from requests.
Endpoints will be given a path with the prefix removed.
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> !RefUnwindSafe for Route<'a, State>
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>
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, 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>,