pub unsafe fn read_slice_at_offset_unchecked<'a, T, S: Slab + ?Sized>(
    slab: &'a S,
    offset: usize,
    len: usize
) -> &'a [T]
Expand description

Reads a &[T] within slab at offset, not checking any requirements.

  • offset is the offset, in bytes, after the start of slab at which a [T; len] is placed.
  • len is the length of the returned slice, counted in elements of T.

Safety

You must ensure:

  • offset within slab is properly aligned for T
  • offset is within bounds of the slab
  • offset + size_of::<T> * len is within bounds of the slab
  • You must have previously fully-initialized a valid* a [T; len] at the given offset into slab.

* Validity is a complex topic not to be taken lightly. See this rust reference page for more details.