[go: up one dir, main page]

Struct lever::sync::atomics::AtomicBox[][src]

pub struct AtomicBox<T: Sized> { /* fields omitted */ }

AtomicBox is a safe wrapper around AtomicPtr

Implementations

impl<T: Sized> AtomicBox<T>[src]

pub fn new(value: T) -> AtomicBox<T>[src]

Allocates a new AtomicBox containing the given value

pub fn get(&self) -> Arc<T>[src]

Get inner value

pub fn extract_mut_ptr(&mut self) -> *mut T[src]

Extract mutable pointer of the contained value

pub fn extract(&self) -> Result<Arc<T>>[src]

If possible, extract inner value into unique Arc

pub fn replace_with<F>(&self, f: F) where
    F: Fn(Arc<T>) -> T, 
[src]

Atomically replace the inner value with the result of applying the given closure to the current value

Trait Implementations

impl<T: Debug + Sized> Debug for AtomicBox<T>[src]

impl<T: Sized> Drop for AtomicBox<T>[src]

impl<T: Sized + PartialEq> PartialEq<AtomicBox<T>> for AtomicBox<T>[src]

impl<T: Sized + Send> Send for AtomicBox<T>[src]

impl<T: Sized + Sync> Sync for AtomicBox<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for AtomicBox<T>[src]

impl<T> Unpin for AtomicBox<T>[src]

impl<T> UnwindSafe for AtomicBox<T> where
    T: RefUnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.