Struct watch::WatchReceiver
source · pub struct WatchReceiver<T> { /* private fields */ }
Expand description
The receiver for the watch channel.
The receiver can be cloned. Each clone will yield a new receiver that receives the same messages.
Implementations§
source§impl<T: Clone> WatchReceiver<T>
impl<T: Clone> WatchReceiver<T>
sourcepub fn get_if_new(&mut self) -> Option<T>
pub fn get_if_new(&mut self) -> Option<T>
Get a clone of the latest value if that value has not previously been seen by this receiver.
sourcepub fn wait(&mut self) -> T
pub fn wait(&mut self) -> T
This method waits until a new value becomes available and return a clone of it.
sourcepub fn wait_timeout(&mut self, duration: Duration) -> Option<T>
pub fn wait_timeout(&mut self, duration: Duration) -> Option<T>
This method waits until a new value becomes available and return a clone of it, timing out after specified duration.
source§impl<T> WatchReceiver<T>
impl<T> WatchReceiver<T>
sourcepub fn new_sender(&self) -> WatchSender<T>
pub fn new_sender(&self) -> WatchSender<T>
Create a new sender for this channel.
Trait Implementations§
source§impl<T> Clone for WatchReceiver<T>
impl<T> Clone for WatchReceiver<T>
source§fn clone(&self) -> WatchReceiver<T>
fn clone(&self) -> WatchReceiver<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 WatchReceiver<T>
impl<T> Send for WatchReceiver<T>where T: Send,
impl<T> Sync for WatchReceiver<T>where T: Send,
impl<T> Unpin for WatchReceiver<T>
impl<T> !UnwindSafe for WatchReceiver<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