Trait boojum::utils::UnsafeCellEx
source · pub trait UnsafeCellEx<T> {
// Required methods
unsafe fn u_deref(&self) -> &'static T;
unsafe fn u_deref_mut(&self) -> &'static mut T;
}
Required Methods§
sourceunsafe fn u_deref(&self) -> &'static T
unsafe fn u_deref(&self) -> &'static T
Dereferences the contained value. Synonym for &*self.get()
.
§Safety
The value must not be referenced outside of the actual lifetime of the UnsafeCell.
Violating this condition is undefined behavior.
sourceunsafe fn u_deref_mut(&self) -> &'static mut T
unsafe fn u_deref_mut(&self) -> &'static mut T
Mutably dereferences the contained value. Synonym for &mut *self.get()
.
§Safety
- The value must not be referenced outside of the actual lifetime of the UnsafeCell.
- The caller must ensure that no other references to the value exist at the same time.
Violating either of these conditions is undefined behavior.
Implementations on Foreign Types§
source§impl<T> UnsafeCellEx<T> for UnsafeCell<T>
impl<T> UnsafeCellEx<T> for UnsafeCell<T>
source§unsafe fn u_deref(&self) -> &'static T
unsafe fn u_deref(&self) -> &'static T
Dereferences the contained value. Synonym for &*self.get()
.
source§unsafe fn u_deref_mut(&self) -> &'static mut T
unsafe fn u_deref_mut(&self) -> &'static mut T
Mutably dereferences the contained value. Synonym for &mut *self.get()
.