mirror of
https://github.com/taosdata/TDengine
synced 2026-05-24 10:09:01 +00:00
* docs: modify rust native test case * docs: modify rust ws test case * docs: modify rust examples * docs: update rust pool docs
17 lines
425 B
Rust
17 lines
425 B
Rust
use taos::*;
|
|
|
|
#[tokio::main]
|
|
async fn main() -> anyhow::Result<()> {
|
|
let dsn = "ws://localhost:6041";
|
|
|
|
match TaosBuilder::from_dsn(dsn)?.build().await {
|
|
Ok(_taos) => {
|
|
println!("Connected to {} successfully.", dsn);
|
|
Ok(())
|
|
}
|
|
Err(err) => {
|
|
eprintln!("Failed to connect to {}, ErrMessage: {}", dsn, err);
|
|
return Err(err.into());
|
|
}
|
|
}
|
|
}
|