doc.rust-lang.org
pub fn ptr_eq(this: &Self, other: &Self) -> bool
Returns true if the two Arcs point to the same allocation in a vein similar to ptr::eqptr::eq. This function ignores the metadata of dyn Trait pointers.
associated_function
alloc
Stable since 1.17.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn pin(data: T) -> Pin<Arc<T>>
Constructs a new Pin<Arc<T>>. If T does not implement Unpin, then data will be pinned in memory and unable to be moved.
associated_function
alloc
Stable since 1.33.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn new_zeroed_slice(len: usize) -> Arc<[mem::MaybeUninit<T>]>
Constructs a new atomically reference-counted slice with uninitialized contents, with the memory being filled with 0 bytes.
associated_function
alloc
Stable since 1.92.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn new_zeroed() -> Arc<mem::MaybeUninit<T>>
Constructs a new Arc with uninitialized contents, with the memory being filled with 0 bytes.
associated_function
alloc
Stable since 1.92.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn new_uninit_slice(len: usize) -> Arc<[mem::MaybeUninit<T>]>
Constructs a new atomically reference-counted slice with uninitialized contents.
associated_function
alloc
Stable since 1.82.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn new_uninit() -> Arc<mem::MaybeUninit<T>>
Constructs a new Arc with uninitialized contents.
associated_function
alloc
Stable since 1.82.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn new_cyclic<F>(data_fn: F) -> Arc<T>
Constructs a new Arc<T> while giving you a Weak<T> to the allocation, to allow you to construct a T which holds a weak pointer to itself.
associated_function
alloc
Stable since 1.60.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn new(data: T) -> Arc<T>
Constructs a new Arc<T>.
associated_function
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn make_mut(this: &mut Self) -> &mut T
Makes a mutable reference into the given Arc.
associated_function
alloc
Stable since 1.4.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_raw(this: Self) -> *const T
Consumes the Arc, returning the wrapped pointer.
associated_function
alloc
Stable since 1.17.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_inner(this: Self) -> Option<T>
Returns the inner value, if the Arc has exactly one strong reference.
associated_function
alloc
Stable since 1.70.0
Version 1.100.0-nightly
doc.rust-lang.org
pub unsafe fn increment_strong_count(ptr: *const T)
Increments the strong reference count on the Arc<T> associated with the provided pointer by one.
associated_function
alloc
Stable since 1.51.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn get_mut(this: &mut Self) -> Option<&mut T>
Returns a mutable reference into the given Arc, if there are no other Arc or Weak pointers to the same allocation.
associated_function
alloc
Stable since 1.4.0
Version 1.100.0-nightly
doc.rust-lang.org
pub unsafe fn from_raw(ptr: *const T) -> Self
Constructs an Arc<T> from a raw pointer.
associated_function
alloc
Stable since 1.17.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn downgrade(this: &Self) -> Weak<T, A>
Creates a new Weak pointer to this allocation.
associated_function
alloc
Stable since 1.4.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn downcast<T>(self) -> Result<Arc<T, A>, Self>
Attempts to downcast the Arc<dyn Any + Send + Sync> to a concrete type.
method
alloc
Stable since 1.29.0
Version 1.100.0-nightly
doc.rust-lang.org
pub unsafe fn decrement_strong_count(ptr: *const T)
Decrements the strong reference count on the Arc<T> associated with the provided pointer by one.
associated_function
alloc
Stable since 1.51.0
Version 1.100.0-nightly
doc.rust-lang.org
pub unsafe fn assume_init(self) -> Arc<T, A>
Converts to Arc<T>.
method
alloc
Stable since 1.82.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn as_ptr(this: &Self) -> *const T
Provides a raw pointer to the data.
associated_function
alloc
Stable since 1.45.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct Arc<T, A>
A thread-safe reference-counting pointer. 'Arc' stands for 'Atomically Reference Counted'.
struct
alloc
Stable since 1.0.0
Version 1.100.0-nightly