| Crates.io | axiom-rs |
| lib.rs | axiom-rs |
| version | 0.11.4 |
| created_at | 2022-07-06 12:07:51.438143+00 |
| updated_at | 2025-08-05 15:06:09.850118+00 |
| description | A Rust SDK for Axiom |
| homepage | https://axiom.co |
| repository | https://github.com/axiomhq/axiom-rs |
| max_upload_size | |
| id | 620429 |
| size | 207,299 |
use axiom_rs::Client;
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Auto-configure the client from the environment variable AXIOM_TOKEN:
let client = Client::new()?;
client
.ingest(
"DATASET_NAME",
vec![json!({
"foo": "bar",
})],
)
.await?;
let _res = client
.query(r#"['DATASET_NAME'] | where foo == "bar" | limit 100"#, None)
.await?;
Ok(())
}
cargo add axiom-rs
You can use the Cargo features:
default-tls: Provides TLS support to connect over HTTPS. Enabled by default.native-tls: Enables TLS functionality provided by native-tls.rustls-tls: Enables TLS functionality provided by rustls.tokio: Enables usage with the tokio runtime. Enabled by default.async-std: Enables usage with the async-std runtime.Read documentation on axiom.co/docs/guides/rust.