Struct clickhouse_readonly::Block
source · pub struct Block<K: ColumnType = Simple> { /* private fields */ }Expand description
Represents Clickhouse Block
Implementations§
source§impl Block
impl Block
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Constructs a new, empty Block with the specified capacity.
source§impl<K: ColumnType> Block<K>
impl<K: ColumnType> Block<K>
sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
Return the number of columns in the current block.
sourcepub fn get<'a, T, I>(&'a self, row: usize, col: I) -> Result<T>where
T: FromSql<'a>,
I: ColumnIdx + Copy,
pub fn get<'a, T, I>(&'a self, row: usize, col: I) -> Result<T>where T: FromSql<'a>, I: ColumnIdx + Copy,
Get the value of a particular cell of the block.
sourcepub fn add_column<S>(self, name: &str, values: S) -> Selfwhere
S: ColumnFrom,
pub fn add_column<S>(self, name: &str, values: S) -> Selfwhere S: ColumnFrom,
Add new column into this block
sourcepub fn column<S>(self, name: &str, values: S) -> Selfwhere
S: ColumnFrom,
pub fn column<S>(self, name: &str, values: S) -> Selfwhere S: ColumnFrom,
Add new column into this block
sourcepub fn push<B: RowBuilder>(&mut self, row: B) -> Result<()>
pub fn push<B: RowBuilder>(&mut self, row: B) -> Result<()>
This method is a convenient way to pass row into a block.
sourcepub fn get_column<I>(&self, col: I) -> Result<&Column<K>>where
I: ColumnIdx + Copy,
pub fn get_column<I>(&self, col: I) -> Result<&Column<K>>where I: ColumnIdx + Copy,
This method finds a column by identifier.