pub struct QueueSender<S, C> { /* private fields */ }
Expand description
An async-supported sending-half of a Queue. This is to support systems that want to asynchronously send items to a receiver, under the assumption that the receiver sends completions to indicate that a request has been finished, and that the send ID can be reused.
Thus, this queue interally allocates, sends, and reuses IDs for requests.
Implementations§
source§impl<S: Copy, C: Copy> QueueSender<S, C>
impl<S: Copy, C: Copy> QueueSender<S, C>
sourcepub fn submit_no_wait(&self, item: S, flags: SubmissionFlags)
pub fn submit_no_wait(&self, item: S, flags: SubmissionFlags)
Submit a request and don’t wait for a response. WARNING: This will burn a request ID, preventing it from ever being reused. This function is mostly useful for signalling an “end of communication” event across the queue. If you want to submit and not immediately await, you probably should create a task for your async block instead.
sourcepub async fn submit_and_wait(&self, item: S) -> Result<C, QueueError>
pub async fn submit_and_wait(&self, item: S) -> Result<C, QueueError>
Submit an item and await a completion.
Auto Trait Implementations§
impl<S, C> !Freeze for QueueSender<S, C>
impl<S, C> !ObjSafe for QueueSender<S, C>
impl<S, C> !RefUnwindSafe for QueueSender<S, C>
impl<S, C> Send for QueueSender<S, C>
impl<S, C> Sync for QueueSender<S, C>
impl<S, C> Unpin for QueueSender<S, C>
impl<S, C> UnwindSafe for QueueSender<S, C>
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