Expand description
Thread-safe reference-counting pointers.
See the Arc<T>
documentation for more details.
Note: This module is only available on platforms that support atomic
loads and stores of pointers. This may be detected at compile time using
#[cfg(target_has_atomic = "ptr")]
.
Macros
- acquire 🔒
Structs
- A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
- ArcInner 🔒
- Helper type to allow accessing the reference counts without making any assertions about the data field.
Constants
- The error in case either counter reaches above
MAX_REFCOUNT
, and we canpanic
safely. - A soft limit on the amount of references that may be made to an
Arc
.
Traits
- Specialization trait used for
From<&[T]>
. - Specialization trait used for collecting into
Arc<[T]>
.
Functions
- Calculate layout for
ArcInner<T>
using the inner value’s layout - data_offset 🔒 ⚠Get the offset within an
ArcInner
for the payload behind a pointer.