Trait resp_async::EventHandler
source · pub trait EventHandler {
type ClientUserData: Default + Send + Sync;
// Required method
fn on_request(
&self,
peer: &mut PeerContext<Self::ClientUserData>,
request: Value
) -> impl Future<Output = Result<Value>> + Send;
// Provided methods
fn on_connect(
&self,
_id: u64
) -> impl Future<Output = Result<Self::ClientUserData>> + Send { ... }
fn on_disconnect(&self, _id: u64) -> impl Future<Output = ()> + Send { ... }
}
Required Associated Types§
type ClientUserData: Default + Send + Sync
Required Methods§
fn on_request( &self, peer: &mut PeerContext<Self::ClientUserData>, request: Value ) -> impl Future<Output = Result<Value>> + Send
Provided Methods§
fn on_connect( &self, _id: u64 ) -> impl Future<Output = Result<Self::ClientUserData>> + Send
fn on_disconnect(&self, _id: u64) -> impl Future<Output = ()> + Send
Object Safety§
This trait is not object safe.