Struct futures_turnstyle::Turnstyle[][src]

pub struct Turnstyle { /* fields omitted */ }

An ordered queue of waiting participants.

Every turn of the turnstyle, the next participant in queue is notified and removed from the queue. If the queue is empty, turn is a noop.

Turnstyles can be cloned and are safe to share across threads.

Methods

impl Turnstyle
[src]

Creates a new, empty turnstyle.

Joins the waiting queue.

Returns a Waiter to the caller, which will complete when the turnstyle turns and reaches the caller's position in the queue.

Turns once, letting a single waiter through.

The Waiter is notified by the future completing.

Trait Implementations

impl Clone for Turnstyle
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Turnstyle

impl Sync for Turnstyle