CopyToUninit

Trait CopyToUninit 

Source
pub trait CopyToUninit<T>
where T: Copy,
{ // Required method fn copy_to_uninit<'a>(&self, dst: &'a mut [MaybeUninit<T>]) -> &'a mut [T]; }
Expand description

Extension trait used to provide a copy_to_uninit() method on built-in slices.

This can be used to safely copy data to the slices returned from WriteChunkUninit::as_mut_slices().

To use this, the trait has to be brought into scope, e.g. with:

use rtrb::CopyToUninit;

Required Methods§

Source

fn copy_to_uninit<'a>(&self, dst: &'a mut [MaybeUninit<T>]) -> &'a mut [T]

Copies contents to a possibly uninitialized slice.

Implementations on Foreign Types§

Source§

impl<T> CopyToUninit<T> for [T]
where T: Copy,

Source§

fn copy_to_uninit<'a>(&self, dst: &'a mut [MaybeUninit<T>]) -> &'a mut [T]

Copies contents to a possibly uninitialized slice.

§Panics

This function will panic if the two slices have different lengths.

Implementors§