[][src]Trait arraylib::MaybeUninitSlice

pub trait MaybeUninitSlice: Slice<Item = MaybeUninit<Self::InitItem>> {
    type InitItem;
    unsafe fn assume_init(&self) -> &[Self::InitItem];
unsafe fn assume_init_mut(&mut self) -> &mut [Self::InitItem];
fn from_init(init: &[Self::InitItem]) -> &Self;
fn from_init_mut(init: &mut [Self::InitItem]) -> &mut Self; }

Extension for maybe uninitialized slices ([MaybeUninit<_>])

Associated Types

type InitItem

Initialized item i.e.

[MaybeUninit<T>]: MaybeUninitSlice<InitItem = T>
Loading content...

Required methods

unsafe fn assume_init(&self) -> &[Self::InitItem]

Assume that all items of self are initialized

Safety

It is up to the caller to guarantee that all elements of the array are really in an initialized state. Calling this when the content is not yet fully initialized causes immediate undefined behavior. The MaybeUninit's type-level documentation contains more information about this initialization invariant.

See also MaybeUninit::assume_init documentation.

unsafe fn assume_init_mut(&mut self) -> &mut [Self::InitItem]

Assume that all items of self are initialized

Safety

It is up to the caller to guarantee that all elements of the array are really in an initialized state. Calling this when the content is not yet fully initialized causes immediate undefined behavior. The MaybeUninit's type-level documentation contains more information about this initialization invariant.

See also MaybeUninit::assume_init documentation.

fn from_init(init: &[Self::InitItem]) -> &Self

Create self from initialized slice

fn from_init_mut(init: &mut [Self::InitItem]) -> &mut Self

Create self from initialized slice

Loading content...

Implementors

impl<T> MaybeUninitSlice for [MaybeUninit<T>][src]

type InitItem = T

Loading content...