pub struct AsyncReceiver<T> { /* private fields */ }Expand description
Receiver-style async facade over scheduler dequeue.
Implementations§
Source§impl<T> AsyncReceiver<T>
impl<T> AsyncReceiver<T>
Sourcepub fn new(scheduler: AsyncScheduler<T>) -> Self
pub fn new(scheduler: AsyncScheduler<T>) -> Self
Creates a new receiver facade.
Source§impl<T: Send + 'static> AsyncReceiver<T>
impl<T: Send + 'static> AsyncReceiver<T>
Sourcepub async fn recv(&self) -> Option<DequeueItem<T>>
pub async fn recv(&self) -> Option<DequeueItem<T>>
Waits for the next task, returning None once scheduler closes.
Sourcepub fn new_worker(
scheduler: AsyncScheduler<T>,
buffer: usize,
) -> AsyncWorkerReceiver<T>
pub fn new_worker( scheduler: AsyncScheduler<T>, buffer: usize, ) -> AsyncWorkerReceiver<T>
Creates a receiver powered by a dedicated dequeue worker thread.
Trait Implementations§
Source§impl<T: Clone> Clone for AsyncReceiver<T>
impl<T: Clone> Clone for AsyncReceiver<T>
Source§fn clone(&self) -> AsyncReceiver<T>
fn clone(&self) -> AsyncReceiver<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for AsyncReceiver<T>
impl<T> !RefUnwindSafe for AsyncReceiver<T>
impl<T> Send for AsyncReceiver<T>where
T: Send,
impl<T> Sync for AsyncReceiver<T>where
T: Send,
impl<T> Unpin for AsyncReceiver<T>
impl<T> !UnwindSafe for AsyncReceiver<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