Struct atomic_ref2::AtomicRef [−][src]
pub struct AtomicRef<T> { /* fields omitted */ }
An atomic reference that may be updated atomically.
Methods
impl<T> AtomicRef<T>
[src]
impl<T> AtomicRef<T>
pub fn new() -> Self where
T: Default,
[src]
pub fn new() -> Self where
T: Default,
Creates a new atomic reference with a default initial value.
pub fn from(
value: impl Into<Arc<T>>
) -> Self
[src]
pub fn from(
value: impl Into<Arc<T>>
) -> Self
Creates a new atomic reference from the given initial value.
pub fn load(&self) -> Arc<T>
[src]
pub fn load(&self) -> Arc<T>
Loads and returns a reference to the value.
pub fn store(
&self,
value: impl Into<Arc<T>>
)
[src]
pub fn store(
&self,
value: impl Into<Arc<T>>
)
Stores the value.
pub fn swap(
&self,
value: impl Into<Arc<T>>
) -> Arc<T>
[src]
pub fn swap(
&self,
value: impl Into<Arc<T>>
) -> Arc<T>
Swaps the value, returning the previous value.