Skip to main content

WebSocketConnection

Trait WebSocketConnection 

Source
pub trait WebSocketConnection {
    // Required methods
    fn send_text(&mut self, text: &str) -> Result<(), String>;
    fn send_binary(&mut self, data: &[u8]) -> Result<(), String>;
    fn close(&mut self, code: u16, reason: &str);
}
Expand description

Uma conexão aberta por um WebSocketProvider: mandar e fechar, da thread da tela.

Required Methods§

Source

fn send_text(&mut self, text: &str) -> Result<(), String>

Source

fn send_binary(&mut self, data: &[u8]) -> Result<(), String>

Source

fn close(&mut self, code: u16, reason: &str)

Fecha (o Closed chega pelos eventos).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§