Function bytes::offset_from

source ·
pub(crate) fn offset_from(dst: *const u8, original: *const 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.