Struct socket_io::socket::Socket
[−]
[src]
pub struct Socket { /* fields omitted */ }
Methods
impl Socket
[src]
fn id(&self) -> String
fn on<F>(&self, event: String, f: F) where F: Fn(Vec<Value>, Option<Vec<Vec<u8>>>) -> Vec<Data> + 'static
fn join(&self, room: String)
fn leave(&self, room: String)
fn emit(&self, event: Value, params: Option<Vec<Data>>)
Emit an event to the client, with the name event
.
fn emit_ack<F>(&self, event: Value, params: Option<Vec<Data>>, on_ack: F) where F: Fn(Option<Value>, Option<Vec<Vec<u8>>>) + 'static
Emit an event to the client, and ask the client for an
acknowledgment. Once received, call on_ack
.
fn close(&mut self)
Close the connection to the client.
Trait Implementations
impl Clone for Socket
[src]
fn clone(&self) -> Socket
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more