Trait possibly_uninit::cast::SlicePointerMut[][src]

pub unsafe trait SlicePointerMut: Sized + StableDeref + Deref<Target = [Self::Item]> + DerefMut {
    type Item: Sized;
    fn into_raw_parts_mut(self) -> (*mut Self::Item, usize);
unsafe fn from_raw_parts_mut(ptr: *mut Self::Item, len: usize) -> Self; }

Trait for unique smart pointers/references containing slices, allowing casting between them.

Associated Types

type Item: Sized[src]

Type of contained item.

Loading content...

Required methods

fn into_raw_parts_mut(self) -> (*mut Self::Item, usize)[src]

Returns pointer and length of the slice, forgetting the original value.

unsafe fn from_raw_parts_mut(ptr: *mut Self::Item, len: usize) -> Self[src]

Converts a raw pointer and length returned from into_raw_mut into smart pointer.

Safety

These operations must be sound (pseudo code ignoring len):

  • `P::from_raw_parts_mut(P::into_raw_parts_mut(x))
  • `P::from_raw_parts_mut(P<MaybeUninit>::into_raw_parts_mut(x) as *mut T)

Where P is the pointer type corresponding to Self and x is a valid value for given smart pointer.

Loading content...

Implementors

impl<T> SlicePointerMut for &mut [T][src]

type Item = T

Loading content...