Skip to main content

WebSocketEngine

Trait WebSocketEngine 

Source
pub trait WebSocketEngine {
    type Command;
    type Error;
    type Response;

    // Required methods
    fn connect(
        &mut self,
        stream: String,
    ) -> impl Future<Output = Result<(), Self::Error>> + Send;
    fn close(&mut self) -> impl Future<Output = Result<(), Self::Error>> + Send;
    fn disconnect(
        &mut self,
    ) -> impl Future<Output = Result<(), Self::Error>> + Send;
    fn handle(
        &self,
        message: Utf8Bytes,
    ) -> impl Future<Output = Result<Self::Response, Self::Error>> + Send;
    fn select_action(
        &mut self,
    ) -> impl Future<Output = Result<(), Self::Error>> + Send;
    fn run(&mut self) -> impl Future<Output = ()> + Send;
}

Required Associated Types§

Required Methods§

Source

fn connect( &mut self, stream: String, ) -> impl Future<Output = Result<(), Self::Error>> + Send

Source

fn close(&mut self) -> impl Future<Output = Result<(), Self::Error>> + Send

Source

fn disconnect(&mut self) -> impl Future<Output = Result<(), Self::Error>> + Send

Source

fn handle( &self, message: Utf8Bytes, ) -> impl Future<Output = Result<Self::Response, Self::Error>> + Send

Source

fn select_action( &mut self, ) -> impl Future<Output = Result<(), Self::Error>> + Send

Source

fn run(&mut self) -> impl Future<Output = ()> + Send

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§