pub trait Serve<Req>: Sized + Clone {
type Resp;
type Fut: Future<Output = Self::Resp>;
// Required method
fn serve(self, ctx: Context, req: Req) -> Self::Fut;
}
Expand description
Basically a Fn(Req) -> impl Future<Output = Resp>;
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.