async_atomic/
lib.rs

1//! Atomics which can be subscribed to and asynchronously notify when updated.
2//!
3//! The main structure is [`AsyncAtomic`] that behaves like stdlib's atomics,
4//! but don't take an explicit [`Ordering`](`core::sync::atomic::Ordering`) for simplicity.
5//!
6//! A reference to [`AsyncAtomic`] can asynchronously wait for updates using methods from [`AsyncAtomicRef`] trait.
7//!
8//! *Note that if there are more than one future at the same time then only the most recently `poll`ed future will be notified.*
9//! *Older futures will never receive an update, so it's up to user to ensure that only one of them `.await`ing at a time.*
10
11#![no_std]
12
13mod async_;
14mod atomic;
15
16pub use atomig::Atom;
17
18pub use async_::*;
19pub use atomic::*;
20
21pub mod prelude {
22    pub use crate::AsyncAtomicRef;
23}
24
25#[cfg(test)]
26mod tests;