Struct websocket::sender::Sender
[−]
[src]
pub struct Sender<W> { /* fields omitted */ }A Sender that wraps a Writer and provides a default implementation using DataFrames and Messages.
Methods
impl<W> Sender<W>[src]
fn new(writer: W, mask: bool) -> Sender<W>
Create a new WebSocketSender using the specified Writer.
fn get_ref(&self) -> &W
Returns a reference to the underlying Writer.
fn get_mut(&mut self) -> &mut W
Returns a mutable reference to the underlying Writer.
impl Sender<WebSocketStream>[src]
fn shutdown(&mut self) -> IoResult<()>
Closes the sender side of the connection, will cause all pending and future IO to return immediately with an appropriate value.
fn shutdown_all(&mut self) -> IoResult<()>
Shuts down both Sender and Receiver, will cause all pending and future IO to return immediately with an appropriate value.
fn set_nonblocking(&self, nonblocking: bool) -> IoResult<()>
Changes whether the sender is in nonblocking mode.
Trait Implementations
impl<W: Write> Sender for Sender<W>[src]
fn send_dataframe<D>(&mut self, dataframe: &D) -> WebSocketResult<()> where
D: DataFrame,
D: DataFrame,
Sends a single data frame to the remote endpoint.
fn send_message<'m, M, D>(&mut self, message: &'m M) -> WebSocketResult<()> where
M: Message<'m, D>,
D: DataFrame,
M: Message<'m, D>,
D: DataFrame,
Sends a single message using this sender.