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.
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.
#[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.