pub struct Sender { /* private fields */ }Expand description
Output of WebSocket connection. Use this to send messages to the other endpoint.
Implementations§
Source§impl Sender
impl Sender
Sourcepub fn new(out: Sender, active: Arc<AtomicBool>) -> Self
pub fn new(out: Sender, active: Arc<AtomicBool>) -> Self
Creates a new Sender.
Sourcepub fn check_active(&self) -> Result<()>
pub fn check_active(&self) -> Result<()>
Checks whether connection is still active
Sourcepub fn send<M>(&self, msg: M) -> Result<()>
pub fn send<M>(&self, msg: M) -> Result<()>
Sends a message over the connection. Will return error if the connection is not active any more.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Sender
impl !RefUnwindSafe for Sender
impl Send for Sender
impl Sync for Sender
impl Unpin for Sender
impl !UnwindSafe for Sender
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