Trait concurrency_traits::semaphore::AsyncTimeoutSemaphore[][src]

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

A generic semaphore that can be waited on asynchronously with a timeout.

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]
#[must_use]
fn wait_timeout_async<'life0, 'async_trait>(
    &'life0 self,
    timeout: Duration
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Awaits until timeout or able to decrement, returning true if decremented or false if timed out.

Implementors