Skip to main content

Module application

Module application 

Source
Expand description

Application: the type a server runs for every request.

An Application gets each parsed Request and its ConnectionInfo and returns a Response (or an error message). The server runs it on many threads, so it must be Clone + Send + 'static.

The built-in App is one: it starts from a 501 response with the default headers and walks a list of Controllers, each checking whether it matches and, if so, filling in the response. Most code uses App, Router or App::with_state instead of implementing this trait directly; see src/application/example/ for a hand-written one.

Traits§

Application
Dispatch trait that wires controllers into a request-handling loop.

Type Aliases§

AsyncResponse
The future Application::execute_async returns.