pub struct Resource<'a, Data> { /* fields omitted */ }
A handle to a resource (identified by a path).
All HTTP requests are made against resources. After using Router::at
(or App::at
) to
establish a resource path, the Resource
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.
After establishing an endpoint, the method will return &mut EndpointData
. This can be used to
set per-endpoint configuration.
"Nest" a subrouter to the path.
This method will build a fresh Router
and give a mutable reference to it to the builder
function. Builder can set up a subrouter using the Router
. All middleware applied inside
the builder will be local to the subrouter and its descendents.
If resources are already present, they will be discarded.
Add an endpoint for the given HTTP method
pub fn get<T: Endpoint<Data, U>, U>(&mut self, ep: T) -> &mut EndpointData<Data> | [src] |
Add an endpoint for GET
requests
pub fn head<T: Endpoint<Data, U>, U>( &mut self, ep: T ) -> &mut EndpointData<Data> | [src] |
Add an endpoint for HEAD
requests
pub fn put<T: Endpoint<Data, U>, U>(&mut self, ep: T) -> &mut EndpointData<Data> | [src] |
Add an endpoint for PUT
requests
pub fn post<T: Endpoint<Data, U>, U>( &mut self, ep: T ) -> &mut EndpointData<Data> | [src] |
Add an endpoint for POST
requests
Add an endpoint for DELETE
requests
Add an endpoint for OPTIONS
requests
Add an endpoint for CONNECT
requests
Add an endpoint for PATCH
requests
Add an endpoint for TRACE
requests
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)