Function presser::read_at_offset_unchecked
source · pub unsafe fn read_at_offset_unchecked<'a, T, S: Slab + ?Sized>(
slab: &'a S,
offset: usize
) -> &'a TExpand description
Gets a shared reference to a T within slab at offset, not checking any requirements.
offsetis the offset, in bytes, after the start ofslabat which aTis placed.
Safety
You must ensure:
offsetwithinslabis properly aligned forToffsetis within bounds of theslaboffset + size_of::<T>is within bounds of theslab- You must have previously fully-initialized a valid*
Tat the given offset intoslab.
* Validity is a complex topic not to be taken lightly. See this rust reference page for more details.