pub(crate) struct Rx<T, S: Semaphore> {
inner: Arc<Chan<T, S>>,
}
Expand description
Channel receiver.
Fields§
§inner: Arc<Chan<T, S>>
Implementations§
source§impl<T, S: Semaphore> Rx<T, S>
impl<T, S: Semaphore> Rx<T, S>
fn new(chan: Arc<Chan<T, S>>) -> Rx<T, S>
pub(crate) fn close(&mut self)
pub(crate) fn is_closed(&self) -> bool
pub(crate) fn is_empty(&self) -> bool
pub(crate) fn len(&self) -> usize
sourcepub(crate) fn recv_many(
&mut self,
cx: &mut Context<'_>,
buffer: &mut Vec<T>,
limit: usize,
) -> Poll<usize>
pub(crate) fn recv_many( &mut self, cx: &mut Context<'_>, buffer: &mut Vec<T>, limit: usize, ) -> Poll<usize>
Receives up to limit
values into buffer
For limit > 0
, receives up to limit values into buffer
.
For limit == 0
, immediately returns Ready(0).
sourcepub(crate) fn try_recv(&mut self) -> Result<T, TryRecvError>
pub(crate) fn try_recv(&mut self) -> Result<T, TryRecvError>
Try to receive the next value.
pub(super) fn semaphore(&self) -> &S
pub(super) fn sender_strong_count(&self) -> usize
pub(super) fn sender_weak_count(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl<T, S> Freeze for Rx<T, S>
impl<T, S> RefUnwindSafe for Rx<T, S>
impl<T, S> Send for Rx<T, S>
impl<T, S> Sync for Rx<T, S>
impl<T, S> Unpin for Rx<T, S>
impl<T, S> UnwindSafe for Rx<T, S>
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