Module sync
Thread-safe reference-counting pointers.
See the [Arc<T>][Arc] 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")].
Structs
- Arc A thread-safe reference-counting pointer. 'Arc' stands for 'Atomically Reference Counted'.
- ArcInner
-
SliceArcInnerForStatic
Struct to hold the static
ArcInnerused for emptyArc<str/CStr/[T]>as returned byDefault::default. -
UniqueArc
A uniquely owned
Arc. -
UniqueArcUninit
A unique owning pointer to an
ArcInnerthat does not imply the contents are initialized, but will deallocate it (without dropping the value) when dropped. -
Weak
Weakis a version ofArcthat 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.
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
ArcInnerfor the payload behind a pointer. - data_offset_alignment
- panic_arc_overflow
Constants
-
MAX_REFCOUNT
A soft limit on the amount of references that may be made to an
Arc. - MAX_STATIC_INNER_SLICE_ALIGNMENT