Skip to main content

WebSocketSocket

Trait WebSocketSocket 

Source
pub trait WebSocketSocket: Send + Sync {
    // Required methods
    fn send_binary<'life0, 'async_trait>(
        &'life0 self,
        data: Bytes,
    ) -> Pin<Box<dyn Future<Output = Result<(), SteamError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn receive<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<WebSocketReceive, SteamError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn close<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), SteamError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn is_open(&self) -> bool;
}
Expand description

A WebSocket socket.

Required Methods§

Source

fn send_binary<'life0, 'async_trait>( &'life0 self, data: Bytes, ) -> Pin<Box<dyn Future<Output = Result<(), SteamError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Sends a binary message.

Source

fn receive<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<WebSocketReceive, SteamError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Receives the next chunk of a message.

Source

fn close<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), SteamError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Closes the socket.

Source

fn is_open(&self) -> bool

Whether the socket is still open.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§