Struct simple_websockets::Responder
source · pub struct Responder { /* private fields */ }
Expand description
Sends outgoing messages to a websocket.
Every connected websocket client has a corresponding Responder
.
Responder
s can be safely cloned and sent across threads, to be used in a
multi-producer single-consumer paradigm.
If a Reponder is dropped while its client is still connected, the connection will be automatically closed. If there are multiple clones of a Responder, The client will not be disconnected until the last Responder is dropped.
Implementations§
source§impl Responder
impl Responder
sourcepub fn send(&self, message: Message) -> bool
pub fn send(&self, message: Message) -> bool
Sends a message to the client represented by this Responder
.
Returns true if the message was sent, or false if it wasn’t sent (because the client is disconnected).
Note that this doesn’t need a mutable reference to self
.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Responder
impl Send for Responder
impl Sync for Responder
impl Unpin for Responder
impl UnwindSafe for Responder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more