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

Gets a shared reference to 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 is placed.

Safety

You must ensure:

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

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