[][src]Crate completion

Utilities for writing completion-based asynchronous code.

A completion future is a future that must be run to completion, unlike regular futures which can be dropped and stopped at any time without the future's knowledge. This allows for more flexibility for the implementor of the future and allows APIs like io_uring and IOCP to be wrapped in a zero-cost way.

This is based off this RFC by Matthias247.

Features

Re-exports

pub use self::future::BoxCompletionFuture;
pub use self::future::LocalBoxCompletionFuture;
pub use self::future::CompletionFuture;
pub use self::future::CompletionFutureExt;
pub use self::future::FutureExt;
pub use self::stream::BoxCompletionStream;
pub use self::stream::LocalBoxCompletionStream;
pub use self::stream::CompletionStream;
pub use self::stream::CompletionStreamExt;
pub use self::stream::StreamExt;

Modules

future

Utilities for the CompletionFuture trait.

io

Utilities for programming with asynchronous I/O.

stream

Utilities for the CompletionStream trait.

Macros

completion_async

A bang macro to generate completion async blocks.

completion_async_move

A bang macro to generate completion async move blocks.

completion_stream

A bang macro to generate completion async streams.

Structs

AssertCompletes

Unsafely assert that the inner future or stream will complete.

MustComplete

Make sure that a future or stream will complete.

Attribute Macros

completion

An attribute macro to generate completion async fns. These async functions evaluate to a CompletionFuture, and you can .await other CompletionFutures inside of them.