pub struct Router<'a, D> { /* private fields */ }
Expand description

A path-based HTTP router supporting exact-match or wildcard placeholders and shared data.

Implementations

Construct a new Router. Or, call Router::with_data(D) to add arbitrary data that will be available to your various routes.

Construct a new Router with arbitrary data that will be available to your various routes.

Register an HTTP handler that will exclusively respond to HEAD requests.

Register an HTTP handler that will exclusively respond to GET requests.

Register an HTTP handler that will exclusively respond to POST requests.

Register an HTTP handler that will exclusively respond to PUT requests.

Register an HTTP handler that will exclusively respond to PATCH requests.

Register an HTTP handler that will exclusively respond to DELETE requests.

Register an HTTP handler that will exclusively respond to OPTIONS requests.

Register an HTTP handler that will respond to any requests.

Register an HTTP handler that will respond to all methods that are not handled explicitly by other handlers.

Register an HTTP handler that will exclusively respond to HEAD requests. Enables the use of async/await syntax in the callback.

Register an HTTP handler that will exclusively respond to GET requests. Enables the use of async/await syntax in the callback.

Register an HTTP handler that will exclusively respond to POST requests. Enables the use of async/await syntax in the callback.

Register an HTTP handler that will exclusively respond to PUT requests. Enables the use of async/await syntax in the callback.

Register an HTTP handler that will exclusively respond to PATCH requests. Enables the use of async/await syntax in the callback.

Register an HTTP handler that will exclusively respond to DELETE requests. Enables the use of async/await syntax in the callback.

Register an HTTP handler that will exclusively respond to OPTIONS requests. Enables the use of async/await syntax in the callback.

Register an HTTP handler that will respond to any requests. Enables the use of async/await syntax in the callback.

Register an HTTP handler that will respond to all methods that are not handled explicitly by other handlers. Enables the use of async/await syntax in the callback.

Handle the request provided to the Router and return a Future.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.