vortex_sequence/compute/
slice.rs1use std::ops::Range;
5
6use vortex_array::ArrayRef;
7use vortex_array::ArrayView;
8use vortex_array::IntoArray;
9use vortex_array::arrays::slice::SliceReduce;
10use vortex_error::VortexResult;
11
12use crate::Sequence;
13
14impl SliceReduce for Sequence {
15 fn slice(array: ArrayView<'_, Self>, range: Range<usize>) -> VortexResult<Option<ArrayRef>> {
16 Ok(Some(
18 unsafe {
19 Sequence::new_unchecked(
20 array.index_value(range.start),
21 array.multiplier(),
22 array.ptype(),
23 array.dtype().nullability(),
24 range.len(),
25 )
26 }
27 .into_array(),
28 ))
29 }
30}