vortex_vector/listview/
mod.rs

1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright the Vortex contributors
3
4//! Definition and implementation of [`ListViewVector`] and [`ListViewVectorMut`].
5//!
6//! A [`ListViewVector`] represents a collection of variable-width lists, where each list can
7//! contain a different number of elements.
8//!
9//! The structure uses separate offset and size vectors to track the boundaries of each list
10//! within the flat elements array. This allows for efficient access to individual lists without
11//! copying data.  This is similar to Apache Arrow's `ListView` type.
12
13// TODO(connor): More docs and examples.
14
15mod vector;
16pub use vector::ListViewVector;
17
18mod vector_mut;
19pub use vector_mut::ListViewVectorMut;
20
21mod scalar;
22pub use scalar::ListViewScalar;
23
24use crate::{Vector, VectorMut};
25
26impl From<ListViewVector> for Vector {
27    fn from(v: ListViewVector) -> Self {
28        Self::List(v)
29    }
30}
31
32impl From<ListViewVectorMut> for VectorMut {
33    fn from(v: ListViewVectorMut) -> Self {
34        Self::List(v)
35    }
36}
37
38#[cfg(test)]
39mod tests;