pub trait HandleRequest: Sized + Send {
type Ok: Into<BytesFrame>;
type Error: ToString;
// Required method
fn handle_request(
self,
conn: &mut Conn,
) -> impl Future<Output = Result<Option<Self::Ok>, Self::Error>> + Send;
// Provided method
fn handle_request_failable(
self,
conn: &mut Conn,
) -> impl Future<Output = Result<Option<BytesFrame>, Error>> + Send { ... }
}Required Associated Types§
Required Methods§
fn handle_request( self, conn: &mut Conn, ) -> impl Future<Output = Result<Option<Self::Ok>, Self::Error>> + Send
Provided Methods§
fn handle_request_failable( self, conn: &mut Conn, ) -> impl Future<Output = Result<Option<BytesFrame>, Error>> + Send
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.