pub trait WebSocket<ClientMsg: Serialize + for<'a> Deserialize<'a> + Send, ServerMsg: Serialize + Debug + for<'a> Deserialize<'a> + Send>: Sized + 'static {
const SERVER_ENDPOINT: &'static str;
const TIMEOUT: f32 = 10.0;
// Provided methods
fn force_start_server() { ... }
fn force_start_client(
handle: impl FnMut(ServerMsg) -> Option<ClientMsg> + 'static + Clone,
on_start: impl FnMut(Self) + 'static,
)
where Self: WebSocketClient<ClientMsg, ServerMsg> { ... }
}Required Associated Constants§
const SERVER_ENDPOINT: &'static str
Provided Associated Constants§
Provided Methods§
fn force_start_server()
Available on crate feature
ssr only.fn force_start_client(
handle: impl FnMut(ServerMsg) -> Option<ClientMsg> + 'static + Clone,
on_start: impl FnMut(Self) + 'static,
)where
Self: WebSocketClient<ClientMsg, ServerMsg>,
Available on crate feature
hydrate only.Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".