Trait hyper_simple_server::Handler[][src]

pub trait Handler where
    Self: Send + Sync + 'static, 
{ type Future: Future<Output = ServerResult<Response<Self::ResponseBody>>> + Send + 'static; type ResponseBody: BodyTrait<Data = Bytes, Error = Self::ResponseBodyError> + Send + 'static; type ResponseBodyError: Error + Send + Sync + 'static; fn handle(&self, _request: Request<Body>) -> Self::Future; fn wrap(self) -> HandlerWrapper<Self>
    where
        Self: Sized
, { ... } }

Associated Types

type Future: Future<Output = ServerResult<Response<Self::ResponseBody>>> + Send + 'static[src]

type ResponseBody: BodyTrait<Data = Bytes, Error = Self::ResponseBodyError> + Send + 'static[src]

type ResponseBodyError: Error + Send + Sync + 'static[src]

Loading content...

Required methods

fn handle(&self, _request: Request<Body>) -> Self::Future[src]

Loading content...

Provided methods

fn wrap(self) -> HandlerWrapper<Self> where
    Self: Sized
[src]

Loading content...

Implementors

impl Handler for EmbeddedResource[src]

impl Handler for FileResource[src]

impl Handler for HandlerDynArc[src]

impl Handler for Routes[src]

impl Handler for StaticResource[src]

impl<C, F, RB> Handler for HandlerFnAsync<C, F, RB> where
    C: Fn(Request<Body>) -> F + Send + Sync + 'static,
    F: Future<Output = ServerResult<Response<RB>>> + Send + 'static,
    RB: BodyTrait<Data = Bytes> + Send + 'static,
    RB::Error: Error + Send + Sync + 'static, 
[src]

type Future = F

type ResponseBody = RB

type ResponseBodyError = RB::Error

impl<C, RB> Handler for HandlerFnSync<C, RB> where
    C: Fn(Request<Body>) -> ServerResult<Response<RB>> + Send + Sync + 'static,
    RB: BodyTrait<Data = Bytes> + Send + 'static,
    RB::Error: Error + Send + Sync + 'static, 
[src]

type Future = Ready<ServerResult<Response<RB>>>

type ResponseBody = RB

type ResponseBodyError = RB::Error

impl<H> Handler for HandlerSimpleAsyncWrapper<H> where
    H: HandlerSimpleAsync,
    H::Future: Unpin
[src]

impl<H> Handler for HandlerSimpleSyncWrapper<H> where
    H: HandlerSimpleSync
[src]

Loading content...