Trait uninit_tools::traits::InitializeVectored [−][src]
pub unsafe trait InitializeVectored { type UninitVector: Initialize; fn as_maybe_uninit_vectors(&self) -> &[Self::UninitVector]ⓘ; unsafe fn as_maybe_uninit_vectors_mut(
&mut self
) -> &mut [Self::UninitVector]ⓘ; }
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.
Required methods
fn as_maybe_uninit_vectors(&self) -> &[Self::UninitVector]ⓘ
[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]ⓘ
[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.
Implementations on Foreign Types
impl<'a, 'b, T> InitializeVectored for &'a mut [&'b mut [MaybeUninit<T>]]
[src]
impl<'a, 'b, T> InitializeVectored for &'a mut [&'b mut [MaybeUninit<T>]]
[src]type UninitVector = &'b mut [MaybeUninit<T>]
fn as_maybe_uninit_vectors(&self) -> &[Self::UninitVector]ⓘ
[src]
unsafe fn as_maybe_uninit_vectors_mut(&mut self) -> &mut [Self::UninitVector]ⓘ
[src]
Implementors
impl<T: Initialize> InitializeVectored for SingleVector<T>
[src]
impl<T: Initialize> InitializeVectored for SingleVector<T>
[src]