Skip to main content

SocketConnection

Trait SocketConnection 

Source
pub trait SocketConnection {
    // Required methods
    fn send(&self, text: &str);
    fn close(&self, code: Option<u16>);
}
Expand description

An open or opening WebSocket.

Required Methods§

Source

fn send(&self, text: &str)

Sends a text frame.

Source

fn close(&self, code: Option<u16>)

Closes the socket. No more events are delivered after this.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§