[][src]Trait reset_router::SharedService

pub trait SharedService {
    type Response: Into<Response>;
    type Error: Into<Box<dyn Error + Send + Sync + 'static>>;
    type Future: Future<Output = Result<Self::Response, Self::Error>> + Send;
    fn call(&self, request: Request) -> Self::Future;
}

Shared trait for route handlers. Similar to tower::Service, but takes &self.

Implemented for H where

H: Fn(Request) -> F,
F: Future<Output = Result<S, E>> + Send,
S: Into<Response>,
E: Into<Response>,

Associated Types

type Response: Into<Response>

type Error: Into<Box<dyn Error + Send + Sync + 'static>>

type Future: Future<Output = Result<Self::Response, Self::Error>> + Send

Loading content...

Required methods

fn call(&self, request: Request) -> Self::Future

Loading content...

Implementors

impl<H, F, S, E> SharedService for H where
    F: Future<Output = Result<S, E>> + Send,
    S: Into<Response>,
    E: Into<Response>,
    H: Fn(Request) -> F, 
[src]

type Response = Response

type Error = Box<dyn Error + Send + Sync + 'static>

type Future = HandlerFuture<F>

Loading content...