pub struct WebSocketGatewayConnection { /* private fields */ }Expand description
In-process WebSocket gateway connection used by adapters and tests.
Implementations§
Source§impl WebSocketGatewayConnection
impl WebSocketGatewayConnection
pub fn id(&self) -> u64
pub fn request(&self) -> &BootRequest
pub fn namespace(&self) -> Option<&str>
pub fn server(&self) -> WebSocketGatewayServer
pub fn rooms(&self) -> Result<Vec<String>>
pub fn join(&self, room: impl Into<String>) -> Result<()>
pub fn leave(&self, room: impl Into<String>) -> Result<()>
pub async fn emit(&self, 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>
pub async fn open(&self) -> Result<()>
pub async fn close(&self) -> Result<()>
pub async fn dispatch( &self, message: WebSocketMessage, ) -> Result<Option<WebSocketMessage>>
Trait Implementations§
Source§impl Clone for WebSocketGatewayConnection
impl Clone for WebSocketGatewayConnection
Source§fn clone(&self) -> WebSocketGatewayConnection
fn clone(&self) -> WebSocketGatewayConnection
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 moreSource§impl WebSocketConnection for WebSocketGatewayConnection
impl WebSocketConnection for WebSocketGatewayConnection
fn request(&self) -> &BootRequest
fn dispatch( &self, message: WebSocketMessage, ) -> BoxFuture<'static, Result<Option<WebSocketMessage>>>
Auto Trait Implementations§
impl !RefUnwindSafe for WebSocketGatewayConnection
impl !UnwindSafe for WebSocketGatewayConnection
impl Freeze for WebSocketGatewayConnection
impl Send for WebSocketGatewayConnection
impl Sync for WebSocketGatewayConnection
impl Unpin for WebSocketGatewayConnection
impl UnsafeUnpin for WebSocketGatewayConnection
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