use influxdb2::models::{LanguageRequest, Query}; use influxdb2::FromDataPoint; #[tokio::main] async fn main() -> Result<(), Box> { let influx_url = "http://localhost:8086"; let token = "some-token"; let client = influxdb2::Client::new(influx_url, "org", token); client.query_suggestions().await?; client.query_suggestions_name("some-name").await?; #[derive(FromDataPoint)] struct Measurement { value: f64, } impl Default for Measurement { fn default() -> Self { Self { value: 0f64 } } } client .query::(Some(Query::new("some-query".to_string()))) .await?; client .query_analyze(Some(Query::new("some-query".to_string()))) .await?; client .query_ast(Some(LanguageRequest::new("some-query".to_string()))) .await?; Ok(()) }