pub struct GenericOneshotBroadcastReceiver<MutexType, T>where
MutexType: RawMutex,
T: Clone + 'static,{ /* private fields */ }
Expand description
The receiving side of a channel which can be used to exchange values between concurrent tasks.
Tasks can receive values from the channel through the receive
method.
The returned Future will get resolved when a value is sent into the channel.
Implementations
sourceimpl<MutexType, T> GenericOneshotBroadcastReceiver<MutexType, T>where
MutexType: RawMutex + 'static,
T: Clone,
impl<MutexType, T> GenericOneshotBroadcastReceiver<MutexType, T>where
MutexType: RawMutex + 'static,
T: Clone,
sourcepub fn receive(&self) -> ChannelReceiveFuture<MutexType, T>ⓘNotable traits for ChannelReceiveFuture<MutexType, T>impl<MutexType, T> Future for ChannelReceiveFuture<MutexType, T> type Output = Option<T>;
pub fn receive(&self) -> ChannelReceiveFuture<MutexType, T>ⓘNotable traits for ChannelReceiveFuture<MutexType, T>impl<MutexType, T> Future for ChannelReceiveFuture<MutexType, T> type Output = Option<T>;
Returns a future that gets fulfilled when a value is written to the channel.
If the channels gets closed, the future will resolve to None
.
Trait Implementations
sourceimpl<MutexType, T> Clone for GenericOneshotBroadcastReceiver<MutexType, T>where
MutexType: RawMutex,
T: Clone + 'static,
impl<MutexType, T> Clone for GenericOneshotBroadcastReceiver<MutexType, T>where
MutexType: RawMutex,
T: Clone + 'static,
sourceimpl<MutexType, T> Debug for GenericOneshotBroadcastReceiver<MutexType, T>where
MutexType: RawMutex,
T: Clone,
impl<MutexType, T> Debug for GenericOneshotBroadcastReceiver<MutexType, T>where
MutexType: RawMutex,
T: Clone,
Auto Trait Implementations
impl<MutexType, T> !RefUnwindSafe for GenericOneshotBroadcastReceiver<MutexType, T>
impl<MutexType, T> Send for GenericOneshotBroadcastReceiver<MutexType, T>where
MutexType: Send + Sync,
T: Send,
impl<MutexType, T> Sync for GenericOneshotBroadcastReceiver<MutexType, T>where
MutexType: Send + Sync,
T: Send,
impl<MutexType, T> Unpin for GenericOneshotBroadcastReceiver<MutexType, T>
impl<MutexType, T> !UnwindSafe for GenericOneshotBroadcastReceiver<MutexType, T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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