1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! This crate provides utilities for writing async Rust code. Unlike many other such crates, it makes a couple of simplifying assumptions:
//!
//! - no cancel-safety required,
//! - futures need not be [`Send`], and
//! - panics always abort the program.
//!
//! See [Frugal Async Rust](https://worm-blossom.org/frugal_async_rust.html) for more details on these assumptions.
//!
//! ## Synchronisation
//!
//! We provide two `.awaitable` synchronisation primitives: [`Mutex`] provides exclusive access to a wrapped value, and [`RwLock`] provides exclusive mutable access or an arbitrary number of concurrent immutable accesses to a wrapped value (think an awaitable [`RefCell`](std::cell::RefCell)).
//!
//! ## Cells
//!
//! The [`OnceCell`] is a cell which starts empty and can be set to a value only once; calling code can `.await` the moment the cell is set to a value.
//!
//! The [`TakeCell`] is a cell which starts empty, whose contents can be set to any value any number of times, and whocse contents can only be accessed through an async `take` method which empties the cell (and which is parked when called on a presently-empty cell).
pub use RwLock;
pub use Mutex;
pub use OnceCell;
pub use TakeCell;
// This is safe if and only if the object pointed at by `reference` lives for at least `'longer`.
// See https://doc.rust-lang.org/nightly/std/intrinsics/fn.transmute.html for more detail.
pub unsafe Sized>
// This is safe if and only if the object pointed at by `reference` lives for at least `'longer`.
// See https://doc.rust-lang.org/nightly/std/intrinsics/fn.transmute.html for more detail.
pub unsafe Sized>