Skip to main content

WebSocketCallback

Trait WebSocketCallback 

Source
pub trait WebSocketCallback {
    // Required method
    async fn run<R: Read, W: Write<Error = R::Error>>(
        self,
        rx: SocketRx<R>,
        tx: SocketTx<W>,
    ) -> Result<(), W::Error>;
}
Available on crate feature ws only.
Expand description

Implement WebSocketCallback to handle and send web socket messages.

Required Methods§

Source

async fn run<R: Read, W: Write<Error = R::Error>>( self, rx: SocketRx<R>, tx: SocketTx<W>, ) -> Result<(), W::Error>

Run the WebSocket connection, reading and writing to the socket.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§