pub trait WebSocketThread: Send + 'static {
type Output: Send;
// Required methods
fn on_message(
&mut self,
message: Message,
) -> impl Future<Output = ()> + Send;
fn on_close(
&mut self,
_clean: bool,
) -> impl Future<Output = Self::Output> + Send;
// Provided method
fn on_open(&mut self) -> impl Future<Output = ()> + Send { ... }
}Expand description
Trait necessary to start a ws read-processing thread
Required Associated Types§
Required Methods§
Provided 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.