pub trait WsConnection {
    // Required methods
    fn recv<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, WsError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn send<'life0, 'async_trait>(
        &'life0 mut self,
        msg: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = Result<(), WsError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Represents the functionality of a Websocket connection with binary messages allowing us to generalize over different websocket implementations

Required Methods§

source

fn recv<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, WsError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn send<'life0, 'async_trait>( &'life0 mut self, msg: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<(), WsError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementations on Foreign Types§

source§

impl WsConnection for WebSocket

source§

fn recv<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, WsError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn send<'life0, 'async_trait>( &'life0 mut self, msg: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<(), WsError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

impl WsConnection for WebSocketStream<MaybeTlsStream<TcpStream>>

source§

fn recv<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, WsError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn send<'life0, 'async_trait>( &'life0 mut self, msg: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<(), WsError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

impl WsConnection for WebSocketStream<TcpStream>

source§

fn recv<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, WsError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn send<'life0, 'async_trait>( &'life0 mut self, msg: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<(), WsError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§