Returns a zero-copy slice of this array with the indicated offset and length.
(&self, offset: usize, length: usize)
| 831 | |
| 832 | /// Returns a zero-copy slice of this array with the indicated offset and length. |
| 833 | pub fn slice(&self, offset: usize, length: usize) -> Self { |
| 834 | Self { |
| 835 | data_type: self.data_type.clone(), |
| 836 | values: self.values.slice(offset, length), |
| 837 | nulls: self.nulls.as_ref().map(|n| n.slice(offset, length)), |
| 838 | } |
| 839 | } |
| 840 | |
| 841 | /// Reinterprets this array's contents as a different data type without copying |
| 842 | /// |