pub struct Column<K: ColumnType> { /* private fields */ }
Expand description
Represents Clickhouse Column
Implementations§
Source§impl<K: ColumnType> Column<K>
impl<K: ColumnType> Column<K>
Sourcepub fn iter<'a, T: Iterable<'a, K>>(&'a self) -> Result<T::Iter>
pub fn iter<'a, T: Iterable<'a, K>>(&'a self) -> Result<T::Iter>
Returns an iterator over the column.
§Example
let mut stream = client
.query("SELECT number as n1, number as n2, number as n3 FROM numbers(100000000)")
.stream_blocks();
let mut sum = 0;
while let Some(block) = stream.next().await {
let block = block?;
let c1 = block.get_column("n1")?.iter::<u64>()?;
let c2 = block.get_column("n2")?.iter::<u64>()?;
let c3 = block.get_column("n3")?.iter::<u64>()?;
for ((v1, v2), v3) in c1.zip(c2).zip(c3) {
sum = v1 + v2 + v3;
}
}
dbg!(sum);
Trait Implementations§
Source§impl<K: ColumnType> Clone for Column<K>
impl<K: ColumnType> Clone for Column<K>
Source§impl<L: ColumnType, R: ColumnType> PartialEq<Column<R>> for Column<L>
impl<L: ColumnType, R: ColumnType> PartialEq<Column<R>> for Column<L>
Auto Trait Implementations§
impl<K> Freeze for Column<K>
impl<K> !RefUnwindSafe for Column<K>
impl<K> Send for Column<K>
impl<K> Sync for Column<K>
impl<K> Unpin for Column<K>where
K: Unpin,
impl<K> !UnwindSafe for Column<K>
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