pub struct AnonRcv<'a, T: Clone, W: WatchBehavior<T> + ?Sized> { /* private fields */ }
Expand description
A anonymous receiver can NOT .await
a change in the Watch
value.
Implementations§
Source§impl<'a, T: Clone, W: WatchBehavior<T> + ?Sized> AnonRcv<'a, T, W>
impl<'a, T: Clone, W: WatchBehavior<T> + ?Sized> AnonRcv<'a, T, W>
Sourcepub fn try_get(&mut self) -> Option<T>
pub fn try_get(&mut self) -> Option<T>
Tries to get the current value of the Watch
without waiting, marking it as seen.
Sourcepub fn try_get_and<F>(&mut self, f: F) -> Option<T>
pub fn try_get_and<F>(&mut self, f: F) -> Option<T>
Tries to get the current value of the Watch
if it matches the predicate
function f
without waiting, marking it as seen.
Sourcepub fn try_changed(&mut self) -> Option<T>
pub fn try_changed(&mut self) -> Option<T>
Tries to get the new value of the watch without waiting, marking it as seen.
Sourcepub fn try_changed_and<F>(&mut self, f: F) -> Option<T>
pub fn try_changed_and<F>(&mut self, f: F) -> Option<T>
Tries to get the new value of the watch which satisfies the predicate
function f
and returns the new value without waiting, marking it as seen.
Sourcepub fn contains_value(&self) -> bool
pub fn contains_value(&self) -> bool
Checks if the Watch
contains a value. If this returns true,
then awaiting Rcv::get
will return immediately.
Auto Trait Implementations§
impl<'a, T, W> Freeze for AnonRcv<'a, T, W>where
W: ?Sized,
impl<'a, T, W> RefUnwindSafe for AnonRcv<'a, T, W>
impl<'a, T, W> Send for AnonRcv<'a, T, W>
impl<'a, T, W> Sync for AnonRcv<'a, T, W>
impl<'a, T, W> Unpin for AnonRcv<'a, T, W>
impl<'a, T, W> UnwindSafe for AnonRcv<'a, T, W>
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