pub trait CopyToUninit<T: Copy + Send + 'static> {
// Required method
fn copy_to_uninit(&self, dst: &mut [MaybeUninit<T>]) -> &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_basedrop::CopyToUninit;
Required Methods§
Sourcefn copy_to_uninit(&self, dst: &mut [MaybeUninit<T>]) -> &mut [T]
fn copy_to_uninit(&self, dst: &mut [MaybeUninit<T>]) -> &mut [T]
Copies contents to a possibly uninitialized slice.
Implementations on Foreign Types§
Source§impl<T: Copy + Send + 'static> CopyToUninit<T> for [T]
impl<T: Copy + Send + 'static> CopyToUninit<T> for [T]
Source§fn copy_to_uninit(&self, dst: &mut [MaybeUninit<T>]) -> &mut [T]
fn copy_to_uninit(&self, dst: &mut [MaybeUninit<T>]) -> &mut [T]
Copies contents to a possibly uninitialized slice.
§Panics
This function will panic if the two slices have different lengths.