vortex_fastlanes/for/vtable/
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::FoR;
13use crate::r#for::array::FoRArrayExt;
14use crate::r#for::array::FoRArraySlotsExt;
15
16impl SliceReduce for FoR {
17 fn slice(array: ArrayView<'_, Self>, range: Range<usize>) -> VortexResult<Option<ArrayRef>> {
18 Ok(Some(
19 FoR::try_new(
20 array.encoded().slice(range)?,
21 array.reference_scalar().clone(),
22 )?
23 .into_array(),
24 ))
25 }
26}