pub trait RequestHandler:
Send
+ Sync
+ 'static {
// Required methods
fn handle_request(
&self,
payload: Vec<u8>,
encoding: &'static str,
) -> Pin<Box<dyn Future<Output = Vec<u8>> + Send>>;
fn handle_push(
&self,
payload: Vec<u8>,
encoding: &'static str,
) -> Pin<Box<dyn Future<Output = ()> + Send>>;
}
Expand description
Trait implemented by servers for handling individual Request
s and Push
es.