datatypes::vectors

Trait MutableVector

Source
pub trait MutableVector: Send + Sync {
    // Required methods
    fn data_type(&self) -> ConcreteDataType;
    fn len(&self) -> usize;
    fn as_any(&self) -> &dyn Any;
    fn as_mut_any(&mut self) -> &mut dyn Any;
    fn to_vector(&mut self) -> VectorRef;
    fn to_vector_cloned(&self) -> VectorRef;
    fn try_push_value_ref(&mut self, value: ValueRef<'_>) -> Result<()>;
    fn push_null(&mut self);
    fn extend_slice_of(
        &mut self,
        vector: &dyn Vector,
        offset: usize,
        length: usize,
    ) -> Result<()>;

    // Provided methods
    fn is_empty(&self) -> bool { ... }
    fn push_value_ref(&mut self, value: ValueRef<'_>) { ... }
    fn push_nulls(&mut self, num_nulls: usize) { ... }
}
Expand description

Mutable vector that could be used to build an immutable vector.

Required Methods§

Source

fn data_type(&self) -> ConcreteDataType

Returns the data type of the vector.

Source

fn len(&self) -> usize

Returns the length of the vector.

Source

fn as_any(&self) -> &dyn Any

Convert to Any, to enable dynamic casting.

Source

fn as_mut_any(&mut self) -> &mut dyn Any

Convert to mutable Any, to enable dynamic casting.

Source

fn to_vector(&mut self) -> VectorRef

Convert self to an (immutable) VectorRef and reset self.

Source

fn to_vector_cloned(&self) -> VectorRef

Convert self to an (immutable) VectorRef and without resetting self.

Source

fn try_push_value_ref(&mut self, value: ValueRef<'_>) -> Result<()>

Try to push value ref to this mutable vector.

Source

fn push_null(&mut self)

Push null to this mutable vector.

Source

fn extend_slice_of( &mut self, vector: &dyn Vector, offset: usize, length: usize, ) -> Result<()>

Extend this mutable vector by slice of vector.

Returns error if data types mismatch.

§Panics

Panics if offset + length > vector.len().

Provided Methods§

Source

fn is_empty(&self) -> bool

Returns whether the vector is empty.

Source

fn push_value_ref(&mut self, value: ValueRef<'_>)

Push value ref to this mutable vector.

§Panics

Panics if error if data types mismatch.

Source

fn push_nulls(&mut self, num_nulls: usize)

Push nulls to this mutable vector.

Implementors§