Trait cataclysm_ws::WebSocketReader[][src]

pub trait WebSocketReader: Send {
    fn on_message<'life0, 'async_trait>(
        &'life0 mut self,
        message: Message
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn on_open<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... }
fn on_close<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } }
Expand description

Receiving part of web sockets connection

By default, a threaded runner is used to keep the websocket connections alive.

Required methods

On message callback

This function gets called back when a Message is received.

Provided methods

On opened connection

This function gets called when the websockets connection is properly stablished.

On opened connection

This function gets called when the websockets connection is closed (either gracefully, or by an error)

Implementors