You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The GetHandle struct that returns from Pool.get_handle() can't use with await :
---- packages ----
[dependencies]
tokio = { version = "1", features = ["full"] }
clickhouse-rs="*"
....
Compiling clickhouse-rs v0.1.21
Compiling tokio v1.33.0
---- code ----
use clickhouse_rs::{Pool, types::Block};
use std::error::Error;
use tokio;
#[tokio::main]
async fn main() -> Result<(), Box> {
let database_url = "";
let pool = Pool::new(database_url);
let mut client = pool.get_handle().await?;
Ok(())
}
---- error message ----
error[E0277]: GetHandle is not a future
--> src/main.rs:9:40
|
9 | let mut client = pool.get_handle().await?;
| -^^^^^
| ||
| |GetHandle is not a future
| help: remove the .await
|
= help: the trait Future is not implemented for GetHandle
= note: GetHandle must be a future or must implement IntoFuture to be awaited
= note: required for GetHandle to implement IntoFuture
For more information about this error, try rustc --explain E0277.
warning: clickhouse-test (bin "clickhouse-test") generated 1 warning
error: could not compile clickhouse-test (bin "clickhouse-test") due to previous error; 1 warning emitted
The text was updated successfully, but these errors were encountered:
The GetHandle struct that returns from Pool.get_handle() can't use with await :
---- packages ----
[dependencies]
tokio = { version = "1", features = ["full"] }
clickhouse-rs="*"
....
Compiling clickhouse-rs v0.1.21
Compiling tokio v1.33.0
---- code ----
use clickhouse_rs::{Pool, types::Block};
use std::error::Error;
use tokio;
#[tokio::main]
async fn main() -> Result<(), Box> {
let database_url = "";
let pool = Pool::new(database_url);
let mut client = pool.get_handle().await?;
Ok(())
}
---- error message ----
error[E0277]:
GetHandle
is not a future--> src/main.rs:9:40
|
9 | let mut client = pool.get_handle().await?;
| -^^^^^
| ||
| |
GetHandle
is not a future| help: remove the
.await
|
= help: the trait
Future
is not implemented forGetHandle
= note: GetHandle must be a future or must implement
IntoFuture
to be awaited= note: required for
GetHandle
to implementIntoFuture
For more information about this error, try
rustc --explain E0277
.warning:
clickhouse-test
(bin "clickhouse-test") generated 1 warningerror: could not compile
clickhouse-test
(bin "clickhouse-test") due to previous error; 1 warning emittedThe text was updated successfully, but these errors were encountered: