[][src]Crate suspend

Structs

Iter

An stream which may be polled asynchronously, or by using blocking operations with an optional timeout.

Listener

The result of acquiring a Suspend using either Suspend::listen or Suspend::try_listen. It may be used to wait for a notification using await or by parking the current thread.

Notifier

An instance of a notifier for a Suspend instance. When notified, the associated thread or Future will be woken if currently suspended.

Suspend

A structure which may be used to suspend a thread or Future pending a notification.

Task

An asynchronous result which may be evaluated using await, or by using blocking operations with an optional timeout.

TimeoutError

A timeout error which may be returned when waiting for a Suspend or Iter with a given timeout.

Functions

block_on

A convenience method to evaluate a Future, blocking the current thread until it is resolved.

iter_stream

A convenience method to turn a Stream into an Iterator which parks the current thread until items are available.

notify_once

Create a new single-use Notifier and a corresponding Task. Once notified, the Task will resolve to ().

Type Definitions

PollFn

A polling function equivalent to Future::poll.

PollNextFn

A polling function equivalent to Stream::poll_next.