arc_swap/docs/mod.rs
1//! Additional documentation.
2//!
3//! Here we have some more general topics that might be good to know that just don't fit to the
4//! crate level intro.
5//!
6//! Also, there were some previous blog posts about the crate which you might find interesting.
7//!
8//! # Atomic orderings
9//!
10//! Each operation on the [`ArcSwapAny`] with [`DefaultStrategy`] type callable concurrently (eg.
11//! [`load`], but not [`into_inner`]) contains at least one [`SeqCst`] atomic read-write operation,
12//! therefore even operations on different instances have a defined global order of operations.
13//!
14//! # Features
15//!
16//! The `weak` feature adds the ability to use arc-swap with the [`Weak`] pointer too,
17//! through the [`ArcSwapWeak`] type. The needed std support is stabilized in rust version 1.45 (as
18//! of now in beta).
19//!
20//! The `experimental-strategies` enables few more strategies that can be used. Note that these
21//! **are not** part of the API stability guarantees and they may be changed, renamed or removed at
22//! any time.
23//!
24//! The `experimental-thread-local` feature can be used to build arc-swap for `no_std` targets, by
25//! replacing occurences of [`std::thread_local!`] with the `#[thread_local]` directive. This
26//! requires a nightly Rust compiler as it makes use of the experimental
27//! [`thread_local`](https://doc.rust-lang.org/unstable-book/language-features/thread-local.html)
28//! feature. Using this features, thread-local variables are compiled using LLVM built-ins, which
29//! have [several underlying modes of
30//! operation](https://doc.rust-lang.org/beta/unstable-book/compiler-flags/tls-model.html). To add
31//! support for thread-local variables on a platform that does not have OS or linker support, the
32//! easiest way is to use `-Ztls-model=emulated` and to implement `__emutls_get_address` by hand,
33//! as in [this
34//! example](https://opensource.apple.com/source/clang/clang-800.0.38/src/projects/compiler-rt/lib/builtins/emutls.c.auto.html)
35//! from Clang.
36//!
37//! # Minimal compiler version
38//!
39//! The `1` versions will compile on all compilers supporting the 2018 edition. Note that this
40//! applies only if no additional feature flags are enabled and does not apply to compiling or
41//! running tests.
42//!
43//! [`ArcSwapAny`]: crate::ArcSwapAny
44//! [`ArcSwapWeak`]: crate::ArcSwapWeak
45//! [`load`]: crate::ArcSwapAny::load
46//! [`into_inner`]: crate::ArcSwapAny::into_inner
47//! [`DefaultStrategy`]: crate::DefaultStrategy
48//! [`SeqCst`]: std::sync::atomic::Ordering::SeqCst
49//! [`Weak`]: std::sync::Weak
50
51pub mod internal;
52pub mod limitations;
53pub mod patterns;
54pub mod performance;