pub fn copy_from_iter_to_offset_with_align<T: Copy, Iter: Iterator<Item = T>, S: Slab>(
    src: Iter,
    dst: &mut S,
    start_offset: usize,
    min_alignment: usize
) -> Result<Vec<CopyRecord>, CopyError>
Available on crate feature std only.
Expand description

Copies from src iterator into the memory represented by dst starting at a minimum location of start_offset bytes past the start of dst.

Returns a vector of CopyRecords, one for each item in the src iterator.

  • start_offset is the offset into the allocation represented by dst, in bytes, before which any copied data will certainly not be placed. However, the actual beginning of the copied data may not be exactly at start_offset if padding bytes are needed to satisfy alignment requirements. The actual beginning of the copied bytes is contained in the returned CopyRecords.
  • min_alignment is the minimum alignment to which the copy will be aligned. The copy may not actually be aligned to min_alignment depending on the alignment requirements of T.
  • For this variation, min_alignment will also be respected between elements yielded by the iterator. To copy inner elements aligned only to align_of::<T>(), see copy_from_iter_to_offset_with_align_packed

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.