pub struct WebSocketGatewayServer { /* private fields */ }Expand description
Adapter-neutral gateway server handle for broadcasting and connection lookup.
Implementations§
Source§impl WebSocketGatewayServer
impl WebSocketGatewayServer
pub fn path(&self) -> &str
pub fn namespace(&self) -> Option<&str>
pub fn events(&self) -> Vec<&str>
pub fn active_connection_count(&self) -> Result<usize>
pub fn active_connection_ids(&self) -> Result<Vec<u64>>
pub fn rooms(&self) -> Result<Vec<String>>
pub fn room_members(&self, room: impl Into<String>) -> Result<Vec<u64>>
pub async fn emit_to_connection( &self, connection_id: u64, message: WebSocketMessage, ) -> Result<bool>
pub async fn broadcast(&self, message: WebSocketMessage) -> Result<usize>
pub async fn broadcast_to_room( &self, room: impl Into<String>, message: WebSocketMessage, ) -> Result<usize>
Trait Implementations§
Source§impl Clone for WebSocketGatewayServer
impl Clone for WebSocketGatewayServer
Source§fn clone(&self) -> WebSocketGatewayServer
fn clone(&self) -> WebSocketGatewayServer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for WebSocketGatewayServer
impl !UnwindSafe for WebSocketGatewayServer
impl Freeze for WebSocketGatewayServer
impl Send for WebSocketGatewayServer
impl Sync for WebSocketGatewayServer
impl Unpin for WebSocketGatewayServer
impl UnsafeUnpin for WebSocketGatewayServer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more