MCPcopy Create free account
hub / github.com/apache/arrow-rs / ptr_offset

Method ptr_offset

arrow-buffer/src/buffer/immutable.rs:109–112  ·  view source on GitHub ↗

Returns the offset, in bytes, of `Self::ptr` to `Self::data` self.ptr and self.data can be different after slicing or advancing the buffer.

(&self)

Source from the content-addressed store, hash-verified

107 ///
108 /// self.ptr and self.data can be different after slicing or advancing the buffer.
109 pub fn ptr_offset(&self) -> usize {
110 // Safety: `ptr` is always in bounds of `data`.
111 unsafe { self.ptr.offset_from(self.data.ptr().as_ptr()) as usize }
112 }
113
114 /// Returns the pointer to the start of the buffer without the offset.
115 pub fn data_ptr(&self) -> NonNull<u8> {

Callers 1

shrink_to_fitMethod · 0.80

Calls 2

ptrMethod · 0.80
as_ptrMethod · 0.45

Tested by

no test coverage detected