99use vortex_dtype:: DType ;
1010use vortex_error:: vortex_panic;
1111
12+ use crate :: fixed_size_list:: FixedSizeListVectorMut ;
1213use crate :: varbin:: { BinaryVectorMut , StringVectorMut } ;
1314use crate :: {
1415 BoolVectorMut , DecimalVectorMut , NullVectorMut , PrimitiveVectorMut , StructVectorMut , Vector ,
@@ -41,6 +42,8 @@ pub enum VectorMut {
4142 String ( StringVectorMut ) ,
4243 /// Mutable Binary vectors.
4344 Binary ( BinaryVectorMut ) ,
45+ /// Mutable vectors of Lists with fixed sizes.
46+ FixedSizeList ( FixedSizeListVectorMut ) ,
4447 /// Mutable vectors of Struct elements.
4548 Struct ( StructVectorMut ) ,
4649}
@@ -54,6 +57,7 @@ impl VectorMut {
5457 DType :: Primitive ( ptype, _) => {
5558 PrimitiveVectorMut :: with_capacity ( * ptype, capacity) . into ( )
5659 }
60+ DType :: FixedSizeList ( ..) => todo ! ( "TODO(connor)" ) ,
5761 DType :: Struct ( struct_fields, _) => {
5862 StructVectorMut :: with_capacity ( struct_fields, capacity) . into ( )
5963 }
@@ -146,6 +150,14 @@ impl VectorMut {
146150 vortex_panic ! ( "Expected BinaryVectorMut, got {self:?}" ) ;
147151 }
148152
153+ /// Returns a reference to the inner [`FixedSizeListVectorMut`] if `self` is of that variant.
154+ pub fn as_fixed_size_list ( & self ) -> & FixedSizeListVectorMut {
155+ if let VectorMut :: FixedSizeList ( v) = self {
156+ return v;
157+ }
158+ vortex_panic ! ( "Expected FixedSizeListVectorMut, got {self:?}" ) ;
159+ }
160+
149161 /// Returns a reference to the inner [`StructVectorMut`] if `self` is of that variant.
150162 pub fn as_struct ( & self ) -> & StructVectorMut {
151163 if let VectorMut :: Struct ( v) = self {
@@ -196,6 +208,15 @@ impl VectorMut {
196208 vortex_panic ! ( "Expected BinaryVectorMut, got {self:?}" ) ;
197209 }
198210
211+ /// Consumes `self` and returns the inner [`FixedSizeListVectorMut`] if `self` is of that
212+ /// variant.
213+ pub fn into_fixed_size_list ( self ) -> FixedSizeListVectorMut {
214+ if let VectorMut :: FixedSizeList ( v) = self {
215+ return v;
216+ }
217+ vortex_panic ! ( "Expected FixedSizeListVectorMut, got {self:?}" ) ;
218+ }
219+
199220 /// Consumes `self` and returns the inner [`StructVectorMut`] if `self` is of that variant.
200221 pub fn into_struct ( self ) -> StructVectorMut {
201222 if let VectorMut :: Struct ( v) = self {
0 commit comments