Trait hyper_static_server::Handler[][src]

pub trait Handler: Send + Sync + 'static {
    type Future: 'static + Send + Future;
    type ResponseBody: 'static + Send + Body;
    type ResponseBodyError: 'static + Error + Send + Sync;
    pub fn handle(&self, _request: Request<Body>) -> Self::Future;

    pub fn wrap(self) -> HandlerWrapper<Self> { ... }
}

Associated Types

type Future: 'static + Send + Future[src]

type ResponseBody: 'static + Send + Body[src]

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

Loading content...

Required methods

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

Loading content...

Provided methods

pub fn wrap(self) -> HandlerWrapper<Self>[src]

Loading content...

Implementors

impl Handler for EmbeddedResource[src]

impl Handler for FileResource[src]

impl Handler for HandlerDynArc[src]

type Future = HandlerFutureDynBox

type ResponseBody = BodyDynBox

type ResponseBodyError = Error

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 = Result<Response<RB>, Error>> + Send + 'static,
    RB: Body<Data = Bytes> + Send + 'static,
    <RB as Body>::Error: Error,
    <RB as Body>::Error: Send,
    <RB as Body>::Error: Sync,
    <RB as Body>::Error: 'static, 
[src]

type Future = F

type ResponseBody = RB

type ResponseBodyError = <RB as Body>::Error

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

type Future = Ready<Result<Response<RB>, Error>>

type ResponseBody = RB

type ResponseBodyError = <RB as Body>::Error

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

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

Loading content...