Trait concurrency_traits::semaphore::AsyncSemaphore[][src]

pub unsafe trait AsyncSemaphore: TrySemaphore {
    #[must_use]
    fn wait_async<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }
Expand description

A generic semaphore that can be waited on asynchronously.

Safety

This trait is marked as unsafe to allow for safe code to rely on the standard semaphore contract. Default implementations should initialize the count at 0.

Required methods

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

Awaits until able to decrement then decrements.

Implementors

impl<C, CS> AsyncSemaphore for FullAsyncSemaphore<C, CS> where
    C: Zero + One + AddAssign + SubAssign + Send,
    CS: ThreadFunctions
[src]

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