pub struct AnonReceiver<'a, M: RawMutex, T: Clone, const N: usize>(/* private fields */);
Expand description
A receiver of a Watch
channel that cannot .await
values.
Implementations§
Source§impl<'a, M: RawMutex, T: Clone, const N: usize> AnonReceiver<'a, M, T, N>
impl<'a, M: RawMutex, T: Clone, const N: usize> AnonReceiver<'a, M, T, N>
Sourcepub fn as_dyn(self) -> DynAnonReceiver<'a, T>
pub fn as_dyn(self) -> DynAnonReceiver<'a, T>
Converts the Receiver
into a DynReceiver
.
Methods from Deref<Target = AnonRcv<'a, T, Watch<M, T, N>>>§
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.
Trait Implementations§
Source§impl<'a, M: RawMutex, T: Clone, const N: usize> Into<DynAnonReceiver<'a, T>> for AnonReceiver<'a, M, T, N>
impl<'a, M: RawMutex, T: Clone, const N: usize> Into<DynAnonReceiver<'a, T>> for AnonReceiver<'a, M, T, N>
Source§fn into(self) -> DynAnonReceiver<'a, T>
fn into(self) -> DynAnonReceiver<'a, T>
Converts this type into the (usually inferred) input type.
Auto Trait Implementations§
impl<'a, M, T, const N: usize> Freeze for AnonReceiver<'a, M, T, N>
impl<'a, M, T, const N: usize> !RefUnwindSafe for AnonReceiver<'a, M, T, N>
impl<'a, M, T, const N: usize> Send for AnonReceiver<'a, M, T, N>
impl<'a, M, T, const N: usize> Sync for AnonReceiver<'a, M, T, N>
impl<'a, M, T, const N: usize> Unpin for AnonReceiver<'a, M, T, N>where
T: Unpin,
impl<'a, M, T, const N: usize> !UnwindSafe for AnonReceiver<'a, M, T, N>
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