Function bytes::bytes_mut::offset_from

source ·
fn offset_from(dst: *mut u8, original: *mut u8) -> usize
Expand description

Precondition: dst >= original

The following line is equivalent to:

self.ptr.as_ptr().offset_from(ptr) as usize;

But due to min rust is 1.39 and it is only stabilized in 1.47, we cannot use it.