pub struct Switch<H, M> { /* private fields */ }
Expand description
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()
.
Implementations§
Trait Implementations§
Source§impl<H, M> Handler for Switch<H, M>where
H: Handler,
M: MultipartHandler,
impl<H, M> Handler for Switch<H, M>where
H: Handler,
M: MultipartHandler,
Source§fn check_continue(&self, _: (&Method, &RequestUri, &Headers)) -> StatusCode
fn check_continue(&self, _: (&Method, &RequestUri, &Headers)) -> StatusCode
Called when a Request includes a
Expect: 100-continue
header. Read moreSource§fn on_connection_start(&self)
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)
Source§fn on_connection_end(&self)
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)
Auto Trait Implementations§
impl<H, M> Freeze for Switch<H, M>
impl<H, M> RefUnwindSafe for Switch<H, M>where
H: RefUnwindSafe,
M: RefUnwindSafe,
impl<H, M> Send for Switch<H, M>
impl<H, M> Sync for Switch<H, M>
impl<H, M> Unpin for Switch<H, M>
impl<H, M> UnwindSafe for Switch<H, M>where
H: UnwindSafe,
M: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more