Skip to main content

potential_well/
lib.rs

1//! Atomic boxes.
2//!
3//! You can use [`Atomic`] and [`AtomicOption`] to access owned pointers to values atomically,
4//! and determine whether smart pointers have to be stored in the atomic.
5//!
6//! You can also implement your own smart pointer types using the [`Well`] trait.
7#![cfg_attr(not(any(feature = "std", test, doc)), no_std)]
8#![cfg_attr(
9    any(coverage_nightly, feature = "nightly"),
10    feature(coverage_attribute)
11)]
12#![cfg_attr(doc, feature(doc_cfg))]
13#![cfg_attr(doc, doc(auto_cfg))]
14#![cfg_attr(feature = "nightly", feature(trait_alias))]
15
16#[cfg(any(doc, test, feature = "alloc"))]
17extern crate alloc;
18
19mod atomic;
20mod inner;
21#[cfg(test)]
22mod tests;
23mod traits;
24
25#[cfg(feature = "alloc")]
26pub use crate::traits::{
27    AtomicArc, AtomicBox, AtomicOptionArc, AtomicOptionBox, AtomicOptionPinArc, AtomicOptionPinBox,
28    AtomicOptionPinRc, AtomicOptionRc, AtomicPinArc, AtomicPinBox, AtomicPinRc, AtomicRc,
29};
30pub use crate::{
31    atomic::{Atomic, AtomicOption, PotentialAtomic, PotentialAtomicOption},
32    traits::{
33        KineticWell, PotentialWell, StrongPotentialWell, StrongWell, StrongWellMut, Target,
34        WeakPotentialWell, WeakWell, Well,
35    },
36};