Crate n0_future

Crate n0_future 

Source
Expand description

Re-exports of abstractions and implementations deemed useful and good by number 0 engineers.

Read up more on our challenges with rust’s async: https://www.iroh.computer/blog/async-rust-challenges-in-iroh

This library also allows importing a single task and time module that’ll work in wasm*-*-unknown targets, using wasm_bindgen and wasm_bindgen_futures, but mirroring the tokio API with only minor differences.

§Feature flags

  • serde: Enables serde support for the time::SystemTime type when building for WebAssembly.

Modules§

boxed
Re-exports boxed versions of Future and Stream traits that are Send in non-wasm and !Send in wasm.
future
Combinators for the Future trait.
io
Tools and combinators for I/O.
split
Implementation and types for splitting a Stream + Sink. See split::split.
stream
Combinators for the Stream trait.
task
Async rust task spawning and utilities that work natively (using tokio) and in browsers (using wasm-bindgen-futures).
time
Sleep and timeout utilities that work natively (via tokio) and in the browser.

Macros§

pin
Pins a variable of type T on the stack and rebinds it as Pin<&mut T>.
ready
Unwraps Poll<T> or returns Pending.

Structs§

BufferUnordered
Stream for the buffered_unordered method.
BufferedOrdered
Stream for the buffered_ordered method.
FuturesOrdered
An unbounded queue of futures.
FuturesOrderedBounded
An unbounded queue of futures.
FuturesUnordered
A set of futures which may complete in any order.
FuturesUnorderedBounded
A set of futures which may complete in any order.
JoinAll
Future for the join_all function.
MergeBounded
A combined stream that releases values in any order that they come
MergeUnbounded
A combined stream that releases values in any order that they come.
TryBufferUnordered
Stream for the try_buffered_unordered method.
TryBufferedOrdered
Stream for the try_buffered_ordered method.
TryJoinAll
Future for the try_join_all function.

Enums§

Either
Combines two different futures, streams, or sinks having the same associated types into a single type.
MaybeFuture
A future which may not be present.

Traits§

BufferedStreamExt
An extension trait for Streams that provides a variety of convenient combinator functions.
BufferedTryStreamExt
An extension trait for Streams that provides a variety of convenient combinator functions.
Future
A future represents an asynchronous computation, commonly obtained by use of async.
FutureExt
Extension trait for Future.
IterExt
Concurrency extensions for iterators of streams and futures.
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
Extension trait for Stream.
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

Functions§

join_all
Creates a future which represents a collection of the outputs of the futures given.
try_join_all
Creates a future which represents a collection of the outputs of the futures given.

Type Aliases§

MergeDeprecated