doc.rust-lang.org
pub struct Vec<T, A>
A contiguous growable array type, written as Vec<T>, short for 'vector'.
struct
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub mod vec
A contiguous growable array type with heap-allocated contents, written Vec<T>.
module
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub macro vec!
Creates a Vec containing the arguments.
macro
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
fn wake_by_ref(self: &Arc<Self>)
Wake this task without consuming the waker.
method
alloc
Stable since 1.51.0
Version 1.100.0-nightly
doc.rust-lang.org
fn wake(self: Arc<Self>)
Wake this task.
method
alloc
Stable since 1.51.0
Version 1.100.0-nightly
doc.rust-lang.org
pub trait Wake
The implementation of waking a task on an executor.
trait
alloc
Stable since 1.51.0
Version 1.100.0-nightly
doc.rust-lang.org
pub mod task
Types and Traits for working with asynchronous tasks.
module
alloc
Stable since 1.51.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn weak_count(&self) -> usize
Gets an approximation of the number of Weak pointers pointing to this allocation.
method
alloc
Stable since 1.41.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn upgrade(&self) -> Option<Arc<T, A>>
Attempts to upgrade the Weak pointer to an Arc, delaying dropping of the inner value if successful.
method
alloc
Stable since 1.4.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn strong_count(&self) -> usize
Gets the number of strong (Arc) pointers pointing to this allocation.
method
alloc
Stable since 1.41.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn ptr_eq(&self, other: &Self) -> bool
Returns true if the two Weaks point to the same allocation similar to ptr::eqptr::eq, or if both don't point to any allocation (because they were created with Weak::new()). However, this function ignores the metadata of dyn Trait pointers.
method
alloc
Stable since 1.39.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn new() -> Weak<T>
Constructs a new Weak<T>, without allocating any memory. Calling upgrade on the return value always gives None.
associated_function
alloc
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_raw(self) -> *const T
Consumes the Weak<T> and turns it into a raw pointer.
method
alloc
Stable since 1.45.0
Version 1.100.0-nightly
doc.rust-lang.org
pub unsafe fn from_raw(ptr: *const T) -> Self
Converts a raw pointer previously created by into_raw back into Weak<T>.
associated_function
alloc
Stable since 1.45.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn as_ptr(&self) -> *const T
Returns a raw pointer to the object T pointed to by this Weak<T>.
method
alloc
Stable since 1.45.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct Weak<T, A>
Weak is a version of Arc that holds a non-owning reference to the managed allocation.
struct
alloc
Stable since 1.4.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn weak_count(this: &Self) -> usize
Gets the number of Weak pointers to this allocation.
associated_function
alloc
Stable since 1.15.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn unwrap_or_clone(this: Self) -> T
If we have the only reference to T then unwrap it. Otherwise, clone T and return the clone.
associated_function
alloc
Stable since 1.76.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn try_unwrap(this: Self) -> Result<T, Self>
Returns the inner value, if the Arc has exactly one strong reference.
associated_function
alloc
Stable since 1.4.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn strong_count(this: &Self) -> usize
Gets the number of strong (Arc) pointers to this allocation.
associated_function
alloc
Stable since 1.15.0
Version 1.100.0-nightly