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 π
- Slice
ArcInner πForStatic - Struct to hold the static
ArcInner
used for emptyArc<str/CStr/[T]>
as returned byDefault::default
. - Unique
ArcUninit π - 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 ofArc
that holds a non-owning reference to the managed allocation.- Weak
Inner π - Helper type to allow accessing the reference counts without making any assertions about the data field.
- Unique
Arc Experimental - A uniquely owned
Arc
.
ConstantsΒ§
- INTERNAL_
OVERFLOW_ πERROR - The error in case either counter reaches above
MAX_REFCOUNT
, and we canpanic
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Β§
- ArcEq
Ident π - ArcFrom
Slice π - Specialization trait used for
From<&[T]>
. - ToArc
Slice π - 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