[][src]Trait uninit::MaybeUninitExt

pub trait MaybeUninitExt {
    type T: ?Sized;
    unsafe fn assume_init_by_ref<'__>(&'__ self) -> &'__ Self::T
    where
        Self: '__,
        Self::T: '__
;
unsafe fn assume_init_by_mut<'__>(&'__ mut self) -> &'__ mut Self::T
    where
        Self: '__,
        Self::T: '__
;
fn from_ref<'__>(init_ref: &'__ Self::T) -> &'__ Self
    where
        Self: '__,
        Self::T: '__
;
fn from_mut<'__>(init_mut: &'__ mut Self::T) -> &'__ mut Self
    where
        Self: '__,
        Self::T: '__
; }

Extension trait providing tranformations between init and uninit.

This is currently only implemented for Copy types, since the semantics when drop glue is involved are less easy to handle correctly (danger of leaking memory).

Associated Types

type T: ?Sized

Loading content...

Required methods

unsafe fn assume_init_by_ref<'__>(&'__ self) -> &'__ Self::T where
    Self: '__,
    Self::T: '__, 

Safety

  • The Self::T that self points to must be initialized.

unsafe fn assume_init_by_mut<'__>(&'__ mut self) -> &'__ mut Self::T where
    Self: '__,
    Self::T: '__, 

Safety

  • The Self::T that self points to must be initialized.

fn from_ref<'__>(init_ref: &'__ Self::T) -> &'__ Self where
    Self: '__,
    Self::T: '__, 

fn from_mut<'__>(init_mut: &'__ mut Self::T) -> &'__ mut Self where
    Self: '__,
    Self::T: '__, 

Loading content...

Implementations on Foreign Types

impl<T: Copy> MaybeUninitExt for MaybeUninit<T>[src]

type T = T

impl<T: Copy> MaybeUninitExt for [MaybeUninit<T>][src]

type T = [T]

Loading content...

Implementors

Loading content...