Skip to main content

SocketEvents

Trait SocketEvents 

Source
pub trait SocketEvents {
    // Required methods
    fn did_open(&self);
    fn did_receive(&self, message: SocketMessage);
    fn did_close(&self, code: u16, reason: &str, was_clean: bool);
}
Expand description

Receives the events of one socket.

Required Methods§

Source

fn did_open(&self)

The socket opened.

Source

fn did_receive(&self, message: SocketMessage)

A frame arrived.

Source

fn did_close(&self, code: u16, reason: &str, was_clean: bool)

The socket closed, with its close code and reason; was_clean when the closing handshake finished.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§