Struct multipart::server::hyper::Switch[][src]

pub struct Switch<H, M> { /* fields omitted */ }
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

impl<H, M> Switch<H, M> where
    H: Handler,
    M: MultipartHandler
[src]

pub fn new(normal: H, multipart: M) -> Switch<H, M>[src]

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>)[src]

Receives a Request/Response pair, and should perform some action on them. Read more

fn check_continue(&self, (&Method, &RequestUri, &Headers)) -> StatusCode[src]

Called when a Request includes a Expect: 100-continue header. Read more

fn on_connection_start(&self)[src]

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]

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> RefUnwindSafe for Switch<H, M> where
    H: RefUnwindSafe,
    M: RefUnwindSafe

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> Unpin for Switch<H, M> where
    H: Unpin,
    M: Unpin

impl<H, M> UnwindSafe for Switch<H, M> where
    H: UnwindSafe,
    M: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V

impl<T> UnsafeAny for T where
    T: Any