Encodes the provided `GenericListArray` to `out` with the provided `SortOptions` `rows` should contain the encoded child elements
(
data: &mut [u8],
offsets: &mut [usize],
rows: &Rows,
opts: SortOptions,
array: &GenericListArray<O>,
)
| 50 | /// |
| 51 | /// `rows` should contain the encoded child elements |
| 52 | pub fn encode<O: OffsetSizeTrait>( |
| 53 | data: &mut [u8], |
| 54 | offsets: &mut [usize], |
| 55 | rows: &Rows, |
| 56 | opts: SortOptions, |
| 57 | array: &GenericListArray<O>, |
| 58 | ) { |
| 59 | let shift = array.value_offsets()[0].as_usize(); |
| 60 | |
| 61 | offsets |
| 62 | .iter_mut() |
| 63 | .skip(1) |
| 64 | .zip(array.value_offsets().windows(2)) |
| 65 | .enumerate() |
| 66 | .for_each(|(idx, (offset, offsets))| { |
| 67 | let start = offsets[0].as_usize() - shift; |
| 68 | let end = offsets[1].as_usize() - shift; |
| 69 | let range = array.is_valid(idx).then_some(start..end); |
| 70 | let out = &mut data[*offset..]; |
| 71 | *offset += encode_one(out, rows, range, opts) |
| 72 | }); |
| 73 | } |
| 74 | |
| 75 | #[inline] |
| 76 | fn encode_one( |
nothing calls this directly
no test coverage detected