pub fn copy_from_slice_to_offset_with_align_exact<T: Copy, S: Slab + ?Sized>(
src: &[T],
dst: &mut S,
start_offset: usize,
min_alignment: usize
) -> Result<CopyRecord, Error>
Expand description
Copies from slice
into the memory represented by dst
starting at exactly
start_offset
bytes past the start of dst
and with minimum alignment min_alignment
.
start_offset
is the offset into the allocation represented bydst
, in bytes, where the first byte of the copied data will be placed. If the requested start offset does not satisfy computed alignment requirements, an error will be returned and no data will be copied.min_alignment
is the minimum alignment that you are requesting the copy be aligned to. The copy may be aligned greater thanmin_alignment
depending on the alignment requirements ofT
(the actual alignment will be the greater of the two betweenalign_of::<T>()
andmin_align.next_power_of_two()
).- The whole data of the slice will be copied directly, so, alignment between elements
ignores
min_alignment
.
- The whole data of the slice will be copied directly, so, alignment between elements
ignores
Safety
This function is safe on its own, however it is very possible to do unsafe things if you read the copied data in the wrong way. See the crate-level Safety documentation for more.