pub struct Ref<T> { /* private fields */ }Expand description
An alias for a referenced pointer
Implementations§
Source§impl<T> Ref<T>
impl<T> Ref<T>
pub fn as_ptr(&self) -> *const Arc<T>
Sourcepub fn consume(self) -> Arc<T>
pub fn consume(self) -> Arc<T>
Consume this Ref<T> and grab the underlying Arc<T>
Consuming a Ref removes your ability to compare_exchange new data into the underlying
AtomPtr with a previously held data reference. This function is different from
take_clone (or take_copy) however in that it does block garbage collection.
Source§impl<T: Copy> Ref<T>
impl<T: Copy> Ref<T>
Sourcepub fn take_copy(&self) -> T
pub fn take_copy(&self) -> T
Copy the underlying data without consuming the parent Ref<T>
Multiple copies can be taken before garbage collection is released (when the Ref<T> goes
out of scope). Importantly copying the underlying data does not block gc.
For non-Copy structures see take_clone
Source§impl<T: Clone> Ref<T>
impl<T: Clone> Ref<T>
Sourcepub fn take_clone(&self) -> T
pub fn take_clone(&self) -> T
Clone the underlying data structures without consuming the parent Ref<T>
Multiple clones can be made before garbage collection is released (when the Ref<T> goes
out of scope). Importantly cloning the underlying data does not block gc.
For Copy structures see take_copy