Skip to main content

clickhouse_rs/pool/futures/
get_handle.rs

1use tokio::prelude::*;
2
3use crate::{errors::Error, pool::Pool, ClientHandle};
4
5/// Future that resolves to a `ClientHandle`.
6pub struct GetHandle {
7    pool: Pool,
8}
9
10impl GetHandle {
11    pub(crate) fn new(pool: &Pool) -> Self {
12        Self { pool: pool.clone() }
13    }
14}
15
16impl Future for GetHandle {
17    type Item = ClientHandle;
18    type Error = Error;
19
20    fn poll(&mut self) -> Poll<Self::Item, Self::Error> {
21        self.pool.poll()
22    }
23}