pub struct AtomicCell<T> { /* private fields */ }Expand description
Atomic cell with a fully safe API.
Wraps UnsafeCell to provide interior mutability without requiring T: Default.
§Safety
- The constructor guarantees correct initialisation.
- All memory operations are encapsulated.
- Panics if creation is impossible (system error).
Implementations§
Source§impl<T> AtomicCell<T>
impl<T> AtomicCell<T>
Trait Implementations§
Source§impl<T: Default> Default for AtomicCell<T>
impl<T: Default> Default for AtomicCell<T>
impl<T: Send> Send for AtomicCell<T>
impl<T: Sync> Sync for AtomicCell<T>
Auto Trait Implementations§
impl<T> !Freeze for AtomicCell<T>
impl<T> !RefUnwindSafe for AtomicCell<T>
impl<T> Unpin for AtomicCell<T>where
T: Unpin,
impl<T> UnsafeUnpin for AtomicCell<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for AtomicCell<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more