struct ChannelState<T> {
data: Option<VecDeque<T>>,
recv_wakers: Option<Vec<Waker>>,
}Fields§
§data: Option<VecDeque<T>>Buffered data.
This is None when the receiver is gone.
recv_wakers: Option<Vec<Waker>>Wakers for the receiver side.
The receiver will be pending if the buffer is empty and
there are senders left (otherwise this is set to None).
Implementations§
Source§impl<T> ChannelState<T>
impl<T> ChannelState<T>
Sourcefn take_recv_wakers(&mut self) -> Vec<Waker>
fn take_recv_wakers(&mut self) -> Vec<Waker>
Get all recv_wakers and replace with identically-sized buffer.
The wakers should be woken AFTER the lock to this state was dropped.
§Panics
Assumes that channel is NOT closed yet, i.e. that recv_wakers is not None.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ChannelState<T>
impl<T> RefUnwindSafe for ChannelState<T>where
T: RefUnwindSafe,
impl<T> Send for ChannelState<T>where
T: Send,
impl<T> Sync for ChannelState<T>where
T: Sync,
impl<T> Unpin for ChannelState<T>where
T: Unpin,
impl<T> UnwindSafe for ChannelState<T>where
T: 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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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