Trait concurrency_traits::queue::AsyncQueue[][src]

pub trait AsyncQueue: TryQueue {
    #[must_use]
    fn push_async<'life0, 'async_trait>(
        &'life0 self,
        value: Self::Item
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn pop_async<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Self::Item> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }
Expand description

A Queue that can be accessed asynchronously

Required methods

#[must_use]
fn push_async<'life0, 'async_trait>(
    &'life0 self,
    value: Self::Item
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Appends to the queue asynchronously.

#[must_use]
fn pop_async<'life0, 'async_trait>(
    &'life0 self
) -> Pin<Box<dyn Future<Output = Self::Item> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Receives from the queue asynchronously.

Implementors

impl<T, S, CS> AsyncQueue for SemaphoreQueue<T, S, CS> where
    T: Send,
    S: AsyncSemaphore + Send + Sync,
    CS: ThreadFunctions
[src]

fn push_async<'life0, 'async_trait>(
    &'life0 self,
    value: Self::Item
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

fn pop_async<'life0, 'async_trait>(
    &'life0 self
) -> Pin<Box<dyn Future<Output = Self::Item> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]