pub trait Service<Req = ()> {
type Response;
type Error;
// Required method
fn call(
&self,
req: Req,
) -> impl Future<Output = Result<Self::Response, Self::Error>>;
}
Expand description
Trait for simulate Fn<(&Self, Arg)> -> impl Future<Output = Result<T, E>> + '_
.
The function call come from stateful type that can be referenced within returned opaque future.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.