Function read_ptr_at

Source
pub unsafe fn read_ptr_at<T>(bytes: &[u8], offset: &mut usize) -> *mut T
Expand description

Casts a part of provided bytes buffer with the given offset to a mutable pointer to T.

Should be used for single values.

§Safety

This is higly unsafe. This function doesn’t ensure alignment and correctness of provided buffer. The responsibility of such checks is on the caller.