pub struct Produce<P, C> {
pub producer: P,
pub consumer: C,
}Expand description
A named tuple of a producer and consumer for convenience.
The producer and consumer may each be cloned as many times as you want. However when the number of references reaches zero, the other will receive a signal to close. A new consumer may be created at any time by calling [T::consume].
Fields§
§producer: P§consumer: CTrait Implementations§
Auto Trait Implementations§
impl<P, C> Freeze for Produce<P, C>
impl<P, C> RefUnwindSafe for Produce<P, C>where
P: RefUnwindSafe,
C: RefUnwindSafe,
impl<P, C> Send for Produce<P, C>
impl<P, C> Sync for Produce<P, C>
impl<P, C> Unpin for Produce<P, C>
impl<P, C> UnwindSafe for Produce<P, C>where
P: UnwindSafe,
C: UnwindSafe,
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