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;
// Required method
fn call(&self, request: Request) -> Self::Future;
}Expand description
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>,Required 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
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".