geam/future

Compose work from Rust async functions. The Rust application hosting Geam drives that work and reads its shared result.

These operations are currently implemented by Geam. Erlang and JavaScript implementations are not currently available.

Types

One operation and its shared result. Copying a Future shares that operation.

pub type Future(value)

Values

pub fn all(values: List(Future(a))) -> Future(List(a))

Drives the supplied work together and keeps results in input order.

pub fn map(value: Future(a), callback: fn(a) -> b) -> Future(b)

Transforms the result when the Rust host drives the returned Future.

pub fn ready(value: value) -> Future(value)

Creates a Future whose result is already available.

pub fn then(
  value: Future(a),
  callback: fn(a) -> Future(b),
) -> Future(b)

Continues with the Future constructed by the callback.

Search Document