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

Method slice

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

Returns a new [Buffer] that is a slice of this buffer starting at `offset`. This function is `O(1)` and does not copy any data, allowing the same memory region to be shared between buffers. # Panics Panics iff `offset` is larger than `len`.

(&self, offset: usize)

Source from the content-addressed store, hash-verified

250 ///
251 /// Panics iff `offset` is larger than `len`.
252 pub fn slice(&self, offset: usize) -> Self {
253 let mut s = self.clone();
254 s.advance(offset);
255 s
256 }
257
258 /// Increases the offset of this buffer by `offset`
259 ///

Callers 5

test_sliceFunction · 0.45
test_from_foreign_vecFunction · 0.45
test_vec_interopFunction · 0.45

Calls 2

cloneMethod · 0.45
advanceMethod · 0.45

Tested by 5

test_sliceFunction · 0.36
test_from_foreign_vecFunction · 0.36
test_vec_interopFunction · 0.36