[][src]Struct atomic_refcell::AtomicRefCell

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

A threadsafe analogue to RefCell.

Methods

impl<T> AtomicRefCell<T>[src]

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

Creates a new AtomicRefCell containing value.

pub fn into_inner(self) -> T[src]

Consumes the AtomicRefCell, returning the wrapped value.

impl<T: ?Sized> AtomicRefCell<T>[src]

pub fn borrow(&self) -> AtomicRef<T>[src]

Immutably borrows the wrapped value.

pub fn borrow_mut(&self) -> AtomicRefMut<T>[src]

Mutably borrows the wrapped value.

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

Returns a raw pointer to the underlying data in this cell.

External synchronization is needed to avoid data races when dereferencing the pointer.

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

Returns a mutable reference to the wrapped value.

No runtime checks take place (unless debug assertions are enabled) because this call borrows AtomicRefCell mutably at compile-time.

Trait Implementations

impl<T: Clone> Clone for AtomicRefCell<T>[src]

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

impl<T: Default> Default for AtomicRefCell<T>[src]

impl<T: ?Sized + Eq> Eq for AtomicRefCell<T>[src]

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

impl<T: ?Sized + Ord> Ord for AtomicRefCell<T>[src]

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

impl<T: ?Sized + PartialOrd> PartialOrd<AtomicRefCell<T>> for AtomicRefCell<T>[src]

impl<T: ?Sized + Send + Sync> Send for AtomicRefCell<T>[src]

impl<T: ?Sized + Send + Sync> Sync for AtomicRefCell<T>[src]

Auto Trait Implementations

impl<T: ?Sized> Unpin for AtomicRefCell<T> where
    T: Unpin

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<!> for T[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.