[][src]Struct async_wg::WaitGroup

pub struct WaitGroup { /* fields omitted */ }

Enables multiple tasks to synchronize the beginning or end of some computation.

Methods

impl WaitGroup[src]

Important traits for WaitGroup
pub fn new() -> WaitGroup[src]

Creates a new wait group and returns the single reference to it.

Examples

use async_wg::WaitGroup;
let wg = WaitGroup::new();

pub async fn add<'_>(&'_ self, delta: isize)[src]

Add count n.

Panic

  1. The argument delta must be a positive number (> 0).
  2. The max count must be less than isize::max_value() / 2.

pub async fn done<'_>(&'_ self)[src]

Done count 1.

pub async fn count<'_>(&'_ self) -> isize[src]

Get the inner count of WaitGroup, the primary count is 0.

Trait Implementations

impl Clone for WaitGroup[src]

impl Future for WaitGroup[src]

type Output = ()

The type of value produced on completion.

Auto Trait Implementations

Blanket Implementations

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

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

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

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

impl<T> FutureExt for T where
    T: Future + ?Sized
[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

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.