Struct tk_http::server::buffered::BufferedDispatcher
[−]
[src]
pub struct BufferedDispatcher<S: Io, N: NewService<S>> { /* fields omitted */ }
A dispatcher that allows to process request and return response using a one single function
Methods
impl<S: Io, N: NewService<S>> BufferedDispatcher<S, N>[src]
fn new(addr: SocketAddr,
handle: &Handle,
service: N)
-> BufferedDispatcher<S, N>
handle: &Handle,
service: N)
-> BufferedDispatcher<S, N>
Create an instance of bufferd dispatcher
fn max_request_length(&mut self, value: usize)
Sets max request length
impl<S: Io, H, I, T, U> BufferedDispatcher<S, WebsocketFactory<H, I>> where H: Fn(Request, Encoder<S>) -> T,
I: Fn(WriteFramed<S, WebsocketCodec>, ReadFramed<S, WebsocketCodec>) -> U,
T: Future<Item=EncoderDone<S>, Error=Error>,
U: Future<Item=(), Error=()> + 'static[src]
I: Fn(WriteFramed<S, WebsocketCodec>, ReadFramed<S, WebsocketCodec>) -> U,
T: Future<Item=EncoderDone<S>, Error=Error>,
U: Future<Item=(), Error=()> + 'static
fn new_with_websockets(addr: SocketAddr,
handle: &Handle,
http: H,
websockets: I)
-> BufferedDispatcher<S, WebsocketFactory<H, I>>
handle: &Handle,
http: H,
websockets: I)
-> BufferedDispatcher<S, WebsocketFactory<H, I>>
Creates a dispatcher with two functions: one serving http requests and websockets.
Trait Implementations
impl<S: Io, N: NewService<S>> Dispatcher<S> for BufferedDispatcher<S, N>[src]
type Codec = BufferedCodec<N::Instance>
The codec type for this dispatcher Read more
fn headers_received(&mut self, headers: &Head) -> Result<Self::Codec, Error>
Received headers of a request Read more