[][src]Struct clickhouse_rs::types::QueryResult

pub struct QueryResult { /* fields omitted */ }

Result of a query or statement execution.

Implementations

impl QueryResult[src]

pub fn fold<F, T, Fut>(
    self,
    init: T,
    f: F
) -> impl Future<Item = (ClientHandle, T), Error = Error> where
    F: Fn(T, Row<Simple>) -> Fut + Send + Sync + 'static,
    Fut: IntoFuture<Item = T, Error = Error> + Send + 'static,
    Fut::Future: Send,
    T: Send + 'static, 
[src]

Method that applies a function to each row, producing a single, final value.

example:

pool.get_handle()
    .and_then(|c| {
        c.query("SELECT number FROM system.numbers LIMIT 10000000")
            .fold(0, |acc, row| {
                let number: u64 = row.get("number")?;
                Ok(acc + number)
            })
    })

pub fn fetch_all(
    self
) -> Box<dyn Future<Item = (ClientHandle, Block<Complex>), Error = Error> + Send>
[src]

Fetch data from table. It returns a block that contains all rows.

pub fn fold_blocks<F, T, Fut>(
    self,
    init: T,
    f: F
) -> impl Future<Item = (ClientHandle, T), Error = Error> where
    F: Fn(T, Block) -> Fut + Send + 'static,
    Fut: IntoFuture<Item = T, Error = Error> + Send + 'static,
    Fut::Future: Send,
    T: Send + 'static, 
[src]

Method that applies a function to each block, producing a single, final value.

pub fn stream_blocks(
    self
) -> Box<dyn Stream<Item = Block, Error = Error> + Send>
[src]

Method that produces a stream of blocks containing rows

example:

 pool.get_handle()
     .and_then(|c| {
         c.query(sql_query)
             .stream_blocks()
             .for_each(|block| {
                 println!("{:?}\nblock counts: {} rows", block, block.row_count());
             })
     })

pub fn stream_rows(
    self
) -> Box<dyn Stream<Item = Row<'static, Simple>, Error = Error> + Send>
[src]

Method that produces a stream of rows

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.