pub struct StateLayoutCell<const STATE_MAX: usize>(/* private fields */);Expand description
StateLayout wrapper that explicitly opts into interior mutability.
The v1 state layout is designed for concurrent mutation through atomics and raw pointers.
Rust requires such mutation through a shared reference to be mediated by UnsafeCell.
Implementations§
Source§impl<const STATE_MAX: usize> StateLayoutCell<STATE_MAX>
impl<const STATE_MAX: usize> StateLayoutCell<STATE_MAX>
Sourcepub fn from_mut(
inner: &mut StateLayout<STATE_MAX>,
) -> &StateLayoutCell<STATE_MAX>
pub fn from_mut( inner: &mut StateLayout<STATE_MAX>, ) -> &StateLayoutCell<STATE_MAX>
Borrow a StateLayoutCell view over a uniquely-mutable StateLayout.
Sourcepub unsafe fn from_ptr<'a>(
ptr: *mut StateLayout<STATE_MAX>,
) -> &'a StateLayoutCell<STATE_MAX>
pub unsafe fn from_ptr<'a>( ptr: *mut StateLayout<STATE_MAX>, ) -> &'a StateLayoutCell<STATE_MAX>
Borrow a StateLayoutCell view over a raw pointer.
§Safety
ptr must be valid for reads/writes for the lifetime 'a.
Auto Trait Implementations§
impl<const STATE_MAX: usize> !Freeze for StateLayoutCell<STATE_MAX>
impl<const STATE_MAX: usize> !RefUnwindSafe for StateLayoutCell<STATE_MAX>
impl<const STATE_MAX: usize> Send for StateLayoutCell<STATE_MAX>
impl<const STATE_MAX: usize> !Sync for StateLayoutCell<STATE_MAX>
impl<const STATE_MAX: usize> Unpin for StateLayoutCell<STATE_MAX>
impl<const STATE_MAX: usize> UnwindSafe for StateLayoutCell<STATE_MAX>
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