This crate provides an asynchronous, atomic
At a high level, this crate is exactly like
Arc<Mutex<Option<T>>>, except with support for
asynchronous operations. Given an
Aption<T>, you can call
poll_put to attempt to place
a value into the
poll_take to take a value out of the
Option. Both methods
Async::NotReady if the
Option is occupied or empty respectively, and will at
that point have scheduled for the current task to be notified when the
poll_* call may
succeed in the future.
Aption<T> can also be used as a
Sink<SinkItem = T> and
Stream<Item = T> by effectively operating as a single-element channel.
Aption<T> can also be closed using
poll_put after a
will fail, and the next
poll_take will return the current value (if any), and from then on
poll_take will return an error.
An asynchronous, atomic
Indicates that an