pub(super) struct Chan<T, S> {
tx: CachePadded<Tx<T>>,
rx_waker: CachePadded<AtomicWaker>,
notify_rx_closed: Notify,
semaphore: S,
tx_count: AtomicUsize,
tx_weak_count: AtomicUsize,
rx_fields: UnsafeCell<RxFields<T>>,
}
Fields§
§tx: CachePadded<Tx<T>>
Handle to the push half of the lock-free list.
rx_waker: CachePadded<AtomicWaker>
Receiver waker. Notified when a value is pushed into the channel.
notify_rx_closed: Notify
Notifies all tasks listening for the receiver being dropped.
semaphore: S
Coordinates access to channel’s capacity.
tx_count: AtomicUsize
Tracks the number of outstanding sender handles.
When this drops to zero, the send half of the channel is closed.
tx_weak_count: AtomicUsize
Tracks the number of outstanding weak sender handles.
rx_fields: UnsafeCell<RxFields<T>>
Only accessed by Rx
handle.
Implementations§
source§impl<T, S> Chan<T, S>
impl<T, S> Chan<T, S>
fn send(&self, value: T)
pub(super) fn decrement_weak_count(&self)
pub(super) fn increment_weak_count(&self)
pub(super) fn strong_count(&self) -> usize
pub(super) fn weak_count(&self) -> usize
Trait Implementations§
impl<T, S> RefUnwindSafe for Chan<T, S>
impl<T: Send, S: Send> Send for Chan<T, S>
impl<T: Send, S: Sync> Sync for Chan<T, S>
impl<T, S> UnwindSafe for Chan<T, S>
Auto Trait Implementations§
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