Returns a zero-copy slice of this array with the indicated offset and length. Notes: this method does *NOT* slice the underlying values array or modify the values in the offsets buffer. See [`Self::values`] and [`Self::offsets`] for more information.
(&self, offset: usize, length: usize)
| 390 | /// the values in the offsets buffer. See [`Self::values`] and |
| 391 | /// [`Self::offsets`] for more information. |
| 392 | pub fn slice(&self, offset: usize, length: usize) -> Self { |
| 393 | Self { |
| 394 | data_type: self.data_type.clone(), |
| 395 | nulls: self.nulls.as_ref().map(|n| n.slice(offset, length)), |
| 396 | values: self.values.clone(), |
| 397 | value_offsets: self.value_offsets.slice(offset, length), |
| 398 | } |
| 399 | } |
| 400 | |
| 401 | /// Creates a [`GenericListArray`] from an iterator of primitive values |
| 402 | /// # Example |