pub struct ColumnVector<T: FixedSize> { /* private fields */ }Expand description
Generic column for numeric types
Implementations§
Source§impl<T: FixedSize + Clone + Send + Sync + 'static> ColumnVector<T>
impl<T: FixedSize + Clone + Send + Sync + 'static> ColumnVector<T>
Sourcepub fn from_vec(type_: Type, data: Vec<T>) -> Self
pub fn from_vec(type_: Type, data: Vec<T>) -> Self
Create a column from an explicit type and a pre-built vector of values.
Sourcepub fn with_data(self, data: Vec<T>) -> Self
pub fn with_data(self, data: Vec<T>) -> Self
Create a column with initial data (builder pattern)
Sourcepub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserve capacity for additional elements (for benchmarking/optimization)
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clear the column while preserving capacity (for benchmarking/optimization)
Sourcepub fn get(&self, index: usize) -> Option<&T>
pub fn get(&self, index: usize) -> Option<&T>
Return a reference to the value at the given index, or None if out of
bounds.
Source§impl<T: FixedSize + ToType + Clone + Send + Sync + 'static> ColumnVector<T>
Type-inferred constructors for ColumnVector
Implements the type map pattern from C++ Type::CreateSimple<T>()
impl<T: FixedSize + ToType + Clone + Send + Sync + 'static> ColumnVector<T>
Type-inferred constructors for ColumnVector
Implements the type map pattern from C++ Type::CreateSimple<T>()
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new column with type inferred from T Equivalent to C++ pattern where type is determined from template parameter
§Examples
use clickhouse_native_client::column::{Column, ColumnVector};
use clickhouse_native_client::types::Type;
let col = ColumnVector::<i32>::new();
assert_eq!(col.column_type(), &Type::int32());Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a new column with type inferred from T and specified capacity
§Examples
use clickhouse_native_client::column::ColumnVector;
let col = ColumnVector::<u64>::with_capacity(100);
assert_eq!(col.len(), 0);Trait Implementations§
Source§impl<T: FixedSize + ToType> Column for ColumnVector<T>
impl<T: FixedSize + ToType> Column for ColumnVector<T>
Source§fn column_type(&self) -> &Type
fn column_type(&self) -> &Type
Get the type of this column
Source§fn append_column(&mut self, other: ColumnRef) -> Result<()>
fn append_column(&mut self, other: ColumnRef) -> Result<()>
Append another column’s data to this column
Source§fn load_from_buffer(&mut self, buffer: &mut &[u8], rows: usize) -> Result<()>
fn load_from_buffer(&mut self, buffer: &mut &[u8], rows: usize) -> Result<()>
Load column data from byte buffer
Source§fn clone_empty(&self) -> ColumnRef
fn clone_empty(&self) -> ColumnRef
Create an empty clone of this column (same type, no data)
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Downcast to a mutable concrete column type
Source§impl<T: FixedSize + ToType + Clone + Send + Sync + 'static> ColumnTyped<T> for ColumnVector<T>
impl<T: FixedSize + ToType + Clone + Send + Sync + 'static> ColumnTyped<T> for ColumnVector<T>
Auto Trait Implementations§
impl<T> Freeze for ColumnVector<T>
impl<T> RefUnwindSafe for ColumnVector<T>where
T: RefUnwindSafe,
impl<T> Send for ColumnVector<T>
impl<T> Sync for ColumnVector<T>
impl<T> Unpin for ColumnVector<T>where
T: Unpin,
impl<T> UnwindSafe for ColumnVector<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more