Trait AsyncWebSocketTrait

Source
pub trait AsyncWebSocketTrait: Send + Sync {
    // Required methods
    fn send_text<'a>(
        &'a mut self,
        text: &'a str,
    ) -> Pin<Box<dyn Future<Output = WebSocketResult> + Send + 'a>>;
    fn send_binary<'a>(
        &'a mut self,
        data: &'a [u8],
    ) -> Pin<Box<dyn Future<Output = WebSocketResult> + Send + 'a>>;
    fn send_ping<'a>(
        &'a mut self,
        data: &'a [u8],
    ) -> Pin<Box<dyn Future<Output = WebSocketResult> + Send + 'a>>;
    fn send_pong<'a>(
        &'a mut self,
        data: &'a [u8],
    ) -> Pin<Box<dyn Future<Output = WebSocketResult> + Send + 'a>>;
    fn receive<'a>(
        &'a mut self,
    ) -> Pin<Box<dyn Future<Output = WebSocketMessageResult> + Send + 'a>>;
    fn close<'a>(
        &'a mut self,
    ) -> Pin<Box<dyn Future<Output = WebSocketResult> + Send + 'a>>;
    fn is_connected(&self) -> bool;
}

Required Methods§

Source

fn send_text<'a>( &'a mut self, text: &'a str, ) -> Pin<Box<dyn Future<Output = WebSocketResult> + Send + 'a>>

Source

fn send_binary<'a>( &'a mut self, data: &'a [u8], ) -> Pin<Box<dyn Future<Output = WebSocketResult> + Send + 'a>>

Source

fn send_ping<'a>( &'a mut self, data: &'a [u8], ) -> Pin<Box<dyn Future<Output = WebSocketResult> + Send + 'a>>

Source

fn send_pong<'a>( &'a mut self, data: &'a [u8], ) -> Pin<Box<dyn Future<Output = WebSocketResult> + Send + 'a>>

Source

fn receive<'a>( &'a mut self, ) -> Pin<Box<dyn Future<Output = WebSocketMessageResult> + Send + 'a>>

Source

fn close<'a>( &'a mut self, ) -> Pin<Box<dyn Future<Output = WebSocketResult> + Send + 'a>>

Source

fn is_connected(&self) -> bool

Implementors§