[go: up one dir, main page]

Struct worker::Router[][src]

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

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

Implementations

Construct a new Router, with arbitrary data that will be available to your various routes. If no data is needed, provide any valid data. The unit type () is a good option.

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 respond to any requests.

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 respond to any requests. Enables the use of async/await syntax in the callback.

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

Trait Implementations

Returns the “default value” for a type. Read more

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.