pub struct Receiver<'a, M: RawMutex, T: Clone>(/* private fields */);
Expand description
A receiver of a Watch
channel.
Methods from Deref<Target = Rcv<'a, T, Watch<M, T>>>§
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_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 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.
Trait Implementations§
Auto Trait Implementations§
impl<'a, M, T> Freeze for Receiver<'a, M, T>
impl<'a, M, T> !RefUnwindSafe for Receiver<'a, M, T>
impl<'a, M, T> Send for Receiver<'a, M, T>
impl<'a, M, T> Sync for Receiver<'a, M, T>
impl<'a, M, T> Unpin for Receiver<'a, M, T>where
T: Unpin,
impl<'a, M, T> !UnwindSafe for Receiver<'a, M, 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