atomicell/
lib.rs

1//! This crate provides [`AtomicCell`] type - a multi-threaded version of [`RefCell`] from standard library.
2//!
3//! [`AtomicCell`] uses atomics to track borrows and is able to guarantee
4//! absence of mutable aliasing when multiple threads try to borrow concurrently.
5//!
6//! Additionally it exports borrowing primitives [`AtomicBorrow`] and [`AtomicBorrowMut`] in [`borrow`] module.
7//! These types can be used to build other abstractions with atomic borrowing capabilities.
8//!
9//! [`RefCell`]: https://doc.rust-lang.org/core/cell/struct.RefCell.html
10//! [`AtomicBorrow`]: borrow/struct.AtomicBorrow.html
11//! [`AtomicBorrowMut`]: borrow/struct.AtomicBorrowMut.html
12
13#![no_std]
14
15pub mod borrow;
16mod cell;
17mod refs;
18#[cfg(test)]
19mod tests;
20
21pub use self::{
22    cell::AtomicCell,
23    refs::{Ref, RefMut},
24};