pub struct AsyncWorkerReceiver<T> { /* private fields */ }Expand description
Receiver/stream adapter backed by a dedicated dequeue worker thread.
Implementations§
Source§impl<T: Send + 'static> AsyncWorkerReceiver<T>
impl<T: Send + 'static> AsyncWorkerReceiver<T>
Sourcepub fn new(scheduler: AsyncScheduler<T>, buffer: usize) -> Self
pub fn new(scheduler: AsyncScheduler<T>, buffer: usize) -> Self
Creates a new worker-backed receiver.
Sourcepub async fn recv(&mut self) -> Option<DequeueItem<T>>
pub async fn recv(&mut self) -> Option<DequeueItem<T>>
Waits for the next task, returning None once the worker stops.
Trait Implementations§
Source§impl<T> Drop for AsyncWorkerReceiver<T>
impl<T> Drop for AsyncWorkerReceiver<T>
Source§impl<T> Stream for AsyncWorkerReceiver<T>
impl<T> Stream for AsyncWorkerReceiver<T>
Source§type Item = DequeueItem<T>
type Item = DequeueItem<T>
Values yielded by the stream.
Auto Trait Implementations§
impl<T> !Freeze for AsyncWorkerReceiver<T>
impl<T> RefUnwindSafe for AsyncWorkerReceiver<T>
impl<T> Send for AsyncWorkerReceiver<T>where
T: Send,
impl<T> Sync for AsyncWorkerReceiver<T>where
T: Send,
impl<T> Unpin for AsyncWorkerReceiver<T>
impl<T> UnwindSafe for AsyncWorkerReceiver<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