pub trait UnsafeAssign<T>
where Self: Sized,
{ // Required methods unsafe fn new(value: T) -> Self; unsafe fn set(&mut self, value: T); fn get_mut(&mut self) -> NonNull<T>; }

Required Methods§

source

unsafe fn new(value: T) -> Self

Constructs a new UnsafeField

Safety
  • must uphold all invariants of the field
source

unsafe fn set(&mut self, value: T)

Sets the underyling value to value

Safety
  • must uphold all invariants of the field
source

fn get_mut(&mut self) -> NonNull<T>

Gets a raw pointer to the value

Safety
  • msut uphold all invaraints when assigning the pointer

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T, const FIELD_INDEX: usize> UnsafeAssign<T> for UnsafeField<T, FIELD_INDEX>