pub struct UnsafeCell<T>(/* private fields */);
Expand description
Implementations§
source§impl<T> UnsafeCell<T>
impl<T> UnsafeCell<T>
pub const fn new(data: T) -> UnsafeCell<T>
sourcepub fn get_mut(&self) -> MutPtr<T>
pub fn get_mut(&self) -> MutPtr<T>
Note that this has a different signature from the method
of the same name in core::cell::UnsafeCell
.
See https://docs.rs/loom/latest/loom/#handling-loom-api-differences
pub fn get(&self) -> ConstPtr<T>
sourcepub fn untracked_get(&self) -> *mut T
pub fn untracked_get(&self) -> *mut T
This is analogous to core::UnsafeCell::get
in that it returns
a raw pointer instead of an object.
We can’t provide this method under loom without giving up some of loom’s analysis.
Trait Implementations§
source§impl<T: Debug> Debug for UnsafeCell<T>
impl<T: Debug> Debug for UnsafeCell<T>
Auto Trait Implementations§
impl<T> !Freeze for UnsafeCell<T>
impl<T> !RefUnwindSafe for UnsafeCell<T>
impl<T> Send for UnsafeCell<T>where
T: Send,
impl<T> !Sync for UnsafeCell<T>
impl<T> Unpin for UnsafeCell<T>where
T: Unpin,
impl<T> UnwindSafe for UnsafeCell<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