pub trait SocketRouterFunction<Req, Resp>:
Send
+ Sync
+ Clonewhere
Self: Send + Sync + Clone,
Req: Serialize + for<'de> Deserialize<'de> + Clone + Debug,
Resp: Serialize + for<'de> Deserialize<'de> + Clone + Debug,{
// Required method
fn route(
&self,
msg: Req,
connection_id: String,
) -> Pin<Box<dyn Future<Output = Option<Resp>> + Send>>;
}Required Methods§
fn route( &self, msg: Req, connection_id: String, ) -> Pin<Box<dyn Future<Output = Option<Resp>> + 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.