Struct atomic_ref2::AtomicOptionRef [−][src]
pub struct AtomicOptionRef<T> { /* fields omitted */ }
An atomic reference that may be updated atomically.
Methods
impl<T> AtomicOptionRef<T>
[src]
impl<T> AtomicOptionRef<T>
pub fn new() -> Self
[src]
pub fn new() -> Self
Creates a new atomic reference with None
initial value.
pub fn from(
value: impl IntoOptionArc<T>
) -> Self
[src]
pub fn from(
value: impl IntoOptionArc<T>
) -> Self
Creates a new atomic reference from the given initial value.
pub fn is_some(&self) -> bool
[src]
pub fn is_some(&self) -> bool
Returns true
if the optional reference has Some
value.
pub fn load(&self) -> Option<Arc<T>>
[src]
pub fn load(&self) -> Option<Arc<T>>
Loads and returns a reference to the value or None
if the value is not set.
pub fn store(
&self,
value: impl IntoOptionArc<T>
)
[src]
pub fn store(
&self,
value: impl IntoOptionArc<T>
)
Stores the value.
pub fn swap(
&self,
value: impl IntoOptionArc<T>
) -> Option<Arc<T>>
[src]
pub fn swap(
&self,
value: impl IntoOptionArc<T>
) -> Option<Arc<T>>
Swaps the value, returning the previous value.
Trait Implementations
impl<T> Default for AtomicOptionRef<T>
[src]
impl<T> Default for AtomicOptionRef<T>
impl<T> Drop for AtomicOptionRef<T>
[src]
impl<T> Drop for AtomicOptionRef<T>
Auto Trait Implementations
impl<T> Send for AtomicOptionRef<T>
impl<T> Send for AtomicOptionRef<T>
impl<T> Sync for AtomicOptionRef<T>
impl<T> Sync for AtomicOptionRef<T>