[][src]Module geng_core::prelude::futures

Abstractions for asynchronous programming.

This crate provides a number of core abstractions for writing asynchronous code:

  • Futures are single eventual values produced by asynchronous computations. Some programming languages (e.g. JavaScript) call this concept "promise".
  • Streams represent a series of values produced asynchronously.
  • Sinks provide support for asynchronous writing of data.
  • Executors are responsible for running asynchronous tasks.

The crate also contains abstractions for asynchronous I/O and cross-task communication.

Underlying all of this is the task system, which is a form of lightweight threading. Large asynchronous computations are built up using futures, streams and sinks, and then spawned as independent tasks that are run to completion, but do not block the thread running them.

Modules

channel

Cross-task communication.

executor

Task execution.

future

Asynchronous values.

io

Asynchronous I/O.

lock

Futures-powered synchronization primitives.

never

This module contains the Never type.

prelude

A "prelude" for crates using the futures crate.

task

Tools for working with tasks.

Macros

pin_mut

Pins a value on the stack.

ready

Extracts the successful type of a Poll<T>.

Enums

Poll

Indicates whether a value is available or if the current task has been scheduled to receive a wakeup instead.

Traits

AsyncBufRead

Read bytes asynchronously.

AsyncBufReadExt

An extension trait which adds utility methods to AsyncBufRead types.

AsyncRead

Read bytes asynchronously.

AsyncReadExt

An extension trait which adds utility methods to AsyncRead types.

AsyncSeek

Seek bytes asynchronously.

AsyncSeekExt

An extension trait which adds utility methods to AsyncSeek types.

AsyncWrite

Write bytes asynchronously.

AsyncWriteExt

An extension trait which adds utility methods to AsyncWrite types.

Future

A future represents an asynchronous computation.

FutureExt

An extension trait for Futures that provides a variety of convenient adapters.

Sink

A Sink is a value into which other values can be sent, asynchronously.

SinkExt

An extension trait for Sinks that provides a variety of convenient combinator functions.

Stream

A stream of values produced asynchronously.

StreamExt

An extension trait for Streams that provides a variety of convenient combinator functions.

TryFuture

A convenience for futures that return Result values that includes a variety of adapters tailored to such futures.

TryFutureExt

Adapters specific to Result-returning futures

TryStream

A convenience for streams that return Result values that includes a variety of adapters tailored to such futures.

TryStreamExt

Adapters specific to Result-returning streams

Type Definitions

Never

A type with no possible values.