Crate tangle [] [src]

A lightweight futures package inspired by Scala. The goals are to provide a simple interface for creating futures and, most importantly, composing multiple asynchronous actions together. Thus, all futures return Async<T, E> which is an asynchronous equivalent to Result<T, E>, the only difference being that an extra variant Continue(Future<T, E>) allows for composition.

Reexports

pub use Async::Continue;

Macros

async!
async!(Ok(123)) // Async::Ok(123)
compose!

compose!(future! { err!(123) })

err!
future!
ok!

ok!(123)

Structs

Future

A value that will resolve itself sometime in the future, asynchronously. Futures are completely composable which allows you to chain together asynchronous computations.

Promise

Enums

Async

Asynchronous version of Result<T, E> that allows for future composition. Additional macros are provided to work with both Async<T, E> and Result<T, E>.

PromiseState