Trait uninit_tools::traits::InitializeVectored[][src]

pub unsafe trait InitializeVectored {
    type UninitVector: Initialize;
    fn as_maybe_uninit_vectors(&self) -> &[Self::UninitVector]

Notable traits for &'_ mut [u8]

impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
;
unsafe fn as_maybe_uninit_vectors_mut(
        &mut self
    ) -> &mut [Self::UninitVector]

Notable traits for &'_ mut [u8]

impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
; }

A trait for slices (or owned memory) that contain possibly uninitialized slices themselves. That is, the Initialize trait but for singly-indirect slices.

Safety

For this trait to be implemented correctly, as_maybe_uninit_vectors and as_maybe_uninit_vectors_mut must always return the same slices (albeit with different aliasing rules as they take &self and &mut self respectively).

Associated Types

type UninitVector: Initialize[src]

The possibly uninitialized vector type, which must implement Initialize. Note that this does not necessarily need to deref into MaybeUninit<Item>, but can be anything that is convertible to it.

Loading content...

Required methods

fn as_maybe_uninit_vectors(&self) -> &[Self::UninitVector]

Notable traits for &'_ mut [u8]

impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
[src]

Get the uninitialized version of all vectors. This slice must always be exactly equal to the slice returned by as_maybe_uninit_vectors_mut, except being borrowed differently, or the trait is unsoundly implemented.

unsafe fn as_maybe_uninit_vectors_mut(&mut self) -> &mut [Self::UninitVector]

Notable traits for &'_ mut [u8]

impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
[src]

Get the uninitialized version of all vectors, mutably. This slice must always be exactly equal to the slice returned by as_maybe_uninit_vectors, or the trait is unsoundly implemented.

Safety

For the user of this trait, the resulting slice returned from this method must not be used to de-initialize the vectors by overwriting their contents with MaybeUninit::uninit if they were already initialized.

Loading content...

Implementations on Foreign Types

impl<'a, 'b, T> InitializeVectored for &'a mut [&'b mut [MaybeUninit<T>]][src]

type UninitVector = &'b mut [MaybeUninit<T>]

Loading content...

Implementors

impl<T: Initialize> InitializeVectored for SingleVector<T>[src]

type UninitVector = T

Loading content...