Returns a zero-copy slice of this array with the indicated offset and length.
(&self, offset: usize, length: usize)
| 360 | |
| 361 | /// Returns a zero-copy slice of this array with the indicated offset and length. |
| 362 | pub fn slice(&self, offset: usize, length: usize) -> Self { |
| 363 | Self { |
| 364 | data_type: T::DATA_TYPE, |
| 365 | value_offsets: self.value_offsets.slice(offset, length), |
| 366 | value_data: self.value_data.clone(), |
| 367 | nulls: self.nulls.as_ref().map(|n| n.slice(offset, length)), |
| 368 | } |
| 369 | } |
| 370 | |
| 371 | /// Returns `GenericByteBuilder` of this byte array for mutating its values if the underlying |
| 372 | /// offset and data buffers are not shared by others. |