pub struct WsServer { /* private fields */ }Expand description
WebSocket Server
Implementations§
Source§impl WsServer
impl WsServer
Sourcepub fn new(
config: WsServerConfig,
handler: impl ServerHandler,
) -> Result<Self, String>
pub fn new( config: WsServerConfig, handler: impl ServerHandler, ) -> Result<Self, String>
Sourcepub async fn send_to_client(
&self,
client_id: &ClientId,
message: WsMessage,
) -> Result<(), String>
pub async fn send_to_client( &self, client_id: &ClientId, message: WsMessage, ) -> Result<(), String>
Sourcepub async fn client_count(&self) -> usize
pub async fn client_count(&self) -> usize
Sourcepub async fn client_list(&self) -> Vec<ClientId>
pub async fn client_list(&self) -> Vec<ClientId>
Auto Trait Implementations§
impl Freeze for WsServer
impl !RefUnwindSafe for WsServer
impl Send for WsServer
impl Sync for WsServer
impl Unpin for WsServer
impl !UnwindSafe for WsServer
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more