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§

source

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.

source

unsafe fn u_deref_mut(&self) -> &'static mut T

Mutably dereferences the contained value. Synonym for &mut *self.get().

§Safety
  1. The value must not be referenced outside of the actual lifetime of the UnsafeCell.
  2. 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>

source§

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

Mutably dereferences the contained value. Synonym for &mut *self.get().

Implementors§