Module sync

1.36.0 Β· Source
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Β§

Arc
A thread-safe reference-counting pointer. β€˜Arc’ stands for β€˜Atomically Reference Counted’.
ArcInner πŸ”’
SliceArcInnerForStatic πŸ”’
Struct to hold the static ArcInner used for empty Arc<str/CStr/[T]> as returned by Default::default.
UniqueArcUninit πŸ”’
A unique owning pointer to an ArcInner that does not imply the contents are initialized, but will deallocate it (without dropping the value) when dropped.
Weak
Weak is a version of Arc that holds a non-owning reference to the managed allocation.
WeakInner πŸ”’
Helper type to allow accessing the reference counts without making any assertions about the data field.
UniqueArcExperimental
A uniquely owned Arc.

ConstantsΒ§

INTERNAL_OVERFLOW_ERROR πŸ”’
The error in case either counter reaches above MAX_REFCOUNT, and we can panic safely.
MAX_REFCOUNT πŸ”’
A soft limit on the amount of references that may be made to an Arc.
MAX_STATIC_INNER_SLICE_ALIGNMENT πŸ”’

StaticsΒ§

STATIC_INNER_SLICE πŸ”’

TraitsΒ§

ArcEqIdent πŸ”’
ArcFromSlice πŸ”’
Specialization trait used for From<&[T]>.
ToArcSlice πŸ”’
Specialization trait used for collecting into Arc<[T]>.

FunctionsΒ§

arcinner_layout_for_value_layout πŸ”’
Calculate layout for ArcInner<T> using the inner value’s layout
data_offset πŸ”’ ⚠
Gets the offset within an ArcInner for the payload behind a pointer.
data_offset_align πŸ”’