Skip to main content

SocketFactory

Trait SocketFactory 

Source
pub trait SocketFactory {
    // Required method
    fn open(
        &self,
        url: &str,
        sec_protocol: Option<&str>,
        events: Rc<dyn SocketEvents>,
    ) -> Box<dyn SocketConnection>;
}
Expand description

Opens the sync socket. Every call is on the engine’s thread.

Required Methods§

Source

fn open( &self, url: &str, sec_protocol: Option<&str>, events: Rc<dyn SocketEvents>, ) -> Box<dyn SocketConnection>

Starts opening a WebSocket to url, sending sec_protocol (when set) as the Sec-WebSocket-Protocol header. Events go to events until the engine closes the socket.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§