Struct watch::WatchSender
source · pub struct WatchSender<T> { /* private fields */ }
Expand description
The sender for the watch channel.
The sender can be cloned to obtain multiple senders for the same channel.
Implementations§
source§impl<T> WatchSender<T>
impl<T> WatchSender<T>
sourcepub fn send(&self, value: T)
pub fn send(&self, value: T)
Send a new message and notify all receivers currently waiting for a message.
sourcepub fn update<F>(&self, f: F)where
F: FnOnce(&mut T),
pub fn update<F>(&self, f: F)where F: FnOnce(&mut T),
Update the message by a closure and notify all receivers currently waiting for a message.
sourcepub fn subscribe(&self) -> WatchReceiver<T>
pub fn subscribe(&self) -> WatchReceiver<T>
Create a new receiver for the channel.
Any messages sent before this method was called are considered seen by the new receiver.
Trait Implementations§
source§impl<T> Clone for WatchSender<T>
impl<T> Clone for WatchSender<T>
source§fn clone(&self) -> WatchSender<T>
fn clone(&self) -> WatchSender<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<T> !RefUnwindSafe for WatchSender<T>
impl<T> Send for WatchSender<T>where T: Send,
impl<T> Sync for WatchSender<T>where T: Send,
impl<T> Unpin for WatchSender<T>
impl<T> !UnwindSafe for WatchSender<T>
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