struct ChannelInner<T: Send> {
buffer: ArrayQueue<T>,
send_waitq: WaitQueue,
recv_waitq: WaitQueue,
status: AtomicU8,
sender_count: AtomicUsize,
receiver_count: AtomicUsize,
}Expand description
Shared inner state for the typed MPMC channel.
Fields§
§buffer: ArrayQueue<T>Bounded message queue.
send_waitq: WaitQueueTasks blocked because the buffer is full (waiting to send).
recv_waitq: WaitQueueTasks blocked because the buffer is empty (waiting to receive).
status: AtomicU8Channel status: CONNECTED / SENDER_GONE / RECEIVER_GONE.
sender_count: AtomicUsizeNumber of live Sender endpoints.
receiver_count: AtomicUsizeNumber of live Receiver endpoints.
Implementations§
Source§impl<T: Send> ChannelInner<T>
impl<T: Send> ChannelInner<T>
Sourcefn is_sender_gone(&self) -> bool
fn is_sender_gone(&self) -> bool
Returns whether sender gone.
Sourcefn is_receiver_gone(&self) -> bool
fn is_receiver_gone(&self) -> bool
Returns whether receiver gone.
Auto Trait Implementations§
impl<T> !Freeze for ChannelInner<T>
impl<T> !RefUnwindSafe for ChannelInner<T>
impl<T> Send for ChannelInner<T>
impl<T> Sync for ChannelInner<T>
impl<T> Unpin for ChannelInner<T>
impl<T> UnsafeUnpin for ChannelInner<T>
impl<T> UnwindSafe for ChannelInner<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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more