Crate async_context

Source
Expand description

A way to have some context within async functions. This can be used to implement React-like hooks.

Structs§

AsyncContext
Stores a future along with the async context provided for it. Create AsyncContext using provide_async_context Access the context using with_async_context or with_async_context_mut

Functions§

provide_async_context
Wraps a future with some async context. Within the future, the provided context can be retrieved using with_async_context or with_async_context_mut
with_async_context
Retrieves immutable ref for async context in order to read values.
with_async_context_mut
Retrieves mutable ref for async context in order to read values.