pub struct AsyncBoundedReceiver<T> { /* private fields */ }
Expand description
An async variant of the BoundedReceiver
that allows your to efficiently
use this Queue in async Contexts as well.
Created using the async_queue
method
Implementations
sourceimpl<T> AsyncBoundedReceiver<T>
impl<T> AsyncBoundedReceiver<T>
sourcepub fn is_closed(&self) -> bool
pub fn is_closed(&self) -> bool
Checks if the Queue has been closed by the Producer
Note
Even when this indicates that the Queue is closed, there might still be Items left in the Queue that the Consumer should dequeue first to make sure that no data is lost
sourcepub fn dequeue(&mut self) -> DequeueFuture<'_, T>ⓘNotable traits for DequeueFuture<'queue, T>impl<'queue, T> Future for DequeueFuture<'queue, T> type Output = Result<T, DequeueError>;
pub fn dequeue(&mut self) -> DequeueFuture<'_, T>ⓘNotable traits for DequeueFuture<'queue, T>impl<'queue, T> Future for DequeueFuture<'queue, T> type Output = Result<T, DequeueError>;
The async variant of the blocking dequeue
operation on the Non-Async version of the Queue
sourcepub fn try_dequeue(&mut self) -> Result<T, DequeueError>
pub fn try_dequeue(&mut self) -> Result<T, DequeueError>
Attempts to dequeue a single Item from the Queue.
This behaves just like the non-async
try_dequeue
operation
Trait Implementations
Auto Trait Implementations
impl<T> !RefUnwindSafe for AsyncBoundedReceiver<T>
impl<T> Send for AsyncBoundedReceiver<T>
impl<T> Sync for AsyncBoundedReceiver<T>
impl<T> Unpin for AsyncBoundedReceiver<T>
impl<T> !UnwindSafe for AsyncBoundedReceiver<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more