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

Method slice

arrow-buffer/src/buffer/boolean.rs:515–525  ·  view source on GitHub ↗

Slices this [`BooleanBuffer`] by the provided `offset` and `length`

(&self, offset: usize, len: usize)

Source from the content-addressed store, hash-verified

513
514 /// Slices this [`BooleanBuffer`] by the provided `offset` and `length`
515 pub fn slice(&self, offset: usize, len: usize) -> Self {
516 assert!(
517 offset.saturating_add(len) <= self.bit_len,
518 "the length + offset of the sliced BooleanBuffer cannot exceed the existing length"
519 );
520 Self {
521 buffer: self.buffer.clone(),
522 bit_offset: self.bit_offset + offset,
523 bit_len: len,
524 }
525 }
526
527 /// Returns a new [`Buffer`] containing the sliced contents of this [`BooleanBuffer`]
528 ///

Calls 1

cloneMethod · 0.45