[−][src]Struct multipart::server::hyper::Switch
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]
impl<H, M> Switch<H, M> where
H: Handler,
M: MultipartHandler,
pub fn new(normal: H, multipart: M) -> Switch<H, M>
[src]
pub 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]
impl<H, M> Handler for Switch<H, M> where
H: Handler,
M: MultipartHandler,
fn handle<'a, 'k>(&'a self, req: Request<'a, 'k>, res: Response<'a, Fresh>)
[src]
fn handle<'a, 'k>(&'a self, req: Request<'a, 'k>, res: Response<'a, Fresh>)
fn check_continue(&self, (&Method, &RequestUri, &Headers)) -> StatusCode
[src]
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)
[src]
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)
[src]
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
Auto Trait Implementations
impl<H, M> Send for Switch<H, M> where
H: Send,
M: Send,
impl<H, M> Send for Switch<H, M> where
H: Send,
M: Send,
impl<H, M> Sync for Switch<H, M> where
H: Sync,
M: Sync,
impl<H, M> Sync for Switch<H, M> where
H: Sync,
M: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
impl<T> Typeable for T where
T: Any,
impl<T> Typeable for T where
T: Any,
impl<F> Handler for F where
F: Fn(Request, Response<Fresh>) + Sync + Send,
[src]
impl<F> Handler for F where
F: Fn(Request, Response<Fresh>) + Sync + Send,
fn handle(&'a self, req: Request<'a, 'k>, res: Response<'a, Fresh>)
[src]
fn handle(&'a self, req: Request<'a, 'k>, res: Response<'a, Fresh>)
fn check_continue(&self, (&Method, &RequestUri, &Headers)) -> StatusCode
[src]
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)
[src]
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)
[src]
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
impl<T> UnsafeAny for T where
T: Any,
impl<T> UnsafeAny for T where
T: Any,