Trait tk_http::server::Dispatcher
[−]
[src]
pub trait Dispatcher<S> { type Codec: Codec<S>; fn headers_received(&mut self, headers: &Head) -> Result<Self::Codec, Error>; }
This is a low-level interface to the http server
Associated Types
type Codec: Codec<S>
The codec type for this dispatcher
In many cases the type is just Box<Codec<S>>
, but it left as
associated type make different types of middleware cheaper.
Required Methods
fn headers_received(&mut self, headers: &Head) -> Result<Self::Codec, Error>
Received headers of a request
At this point we already extracted all the headers and other data
that we need to ensure correctness of the protocol. If you need
to handle some data from the headers you need to store them somewhere
(for example on self
) for further processing.
Implementors
impl<S, N: NewService<S>> Dispatcher<S> for BufferedDispatcher<S, N>