Struct multipart::server::hyper::Switch
[−]
[src]
pub struct Switch<H, M> { // some fields omitted }
A container that implements hyper::server::Handler
which will switch
the handler implementation depending on if the incoming request is multipart or not.
Create an instance with new()
and pass it to hyper::server::Server::listen()
where
you would normally pass a Handler
instance.
A convenient wrapper for Multipart::from_request()
.
Methods
impl<H, M> Switch<H, M> where H: Handler, M: MultipartHandler
[src]
fn new(normal: H, multipart: M) -> Switch<H, M>
Create a new Switch
instance where
normal
handles normal Hyper requests and multipart
handles Multipart requests
Trait Implementations
impl<H, M> Handler for Switch<H, M> where H: Handler, M: MultipartHandler
[src]
fn handle<'a, 'k>(&'a self, req: Request<'a, 'k>, res: Response<'a, Fresh>)
Receives a Request
/Response
pair, and should perform some action on them. Read more
fn check_continue(&self, (&Method, &RequestUri, &Headers)) -> StatusCode
Called when a Request includes a Expect: 100-continue
header. Read more
fn on_connection_start(&self)
This is run after a connection is received, on a per-connection basis (not a per-request basis, as a connection with keep-alive may handle multiple requests) Read more
fn on_connection_end(&self)
This is run before a connection is closed, on a per-connection basis (not a per-request basis, as a connection with keep-alive may handle multiple requests) Read more