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
sourceimpl<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
sourceimpl<T> Clone for WatchSender<T>
impl<T> Clone for WatchSender<T>
sourcefn clone(&self) -> WatchSender<T>
fn clone(&self) -> WatchSender<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more