Struct concurrency_traits::semaphore::FullAsyncSemaphore[][src]

pub struct FullAsyncSemaphore<C, CS> { /* fields omitted */ }
Expand description

A semaphore that has asynchronous operations.

Implementations

impl<C, CS> FullAsyncSemaphore<C, CS>[src]

pub fn new(start_count: C) -> Self[src]

Creates a new FullAsyncSemaphore from a starting count.

Trait Implementations

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]

Awaits until able to decrement then decrements.

impl<C: Debug, CS: Debug> Debug for FullAsyncSemaphore<C, CS>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<C, CS> Default for FullAsyncSemaphore<C, CS> where
    C: Zero
[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

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

type Count = C

The type of the count read from this semaphore.

fn count(&self) -> Self::Count[src]

The count associated with this semaphore.

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

fn try_wait(&self) -> bool[src]

Returns true if can decrement and did, or false if cannot.

fn signal(&self)[src]

Increments the counter.

Auto Trait Implementations

impl<C, CS> !RefUnwindSafe for FullAsyncSemaphore<C, CS>

impl<C, CS> Send for FullAsyncSemaphore<C, CS> where
    C: Send

impl<C, CS> Sync for FullAsyncSemaphore<C, CS> where
    C: Send

impl<C, CS> Unpin for FullAsyncSemaphore<C, CS> where
    C: Unpin

impl<C, CS> !UnwindSafe for FullAsyncSemaphore<C, CS>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.