Expand description
The Rust SDK for Axiom.
If you’re just getting started, take a look at the Client
.
It contains all methods you’ll need to interact with the API.
§Examples
use axiom_rs::{Client, Error};
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Error> {
let client = Client::new()?;
// Create a dataset called my-dataset
let dataset = client.datasets().create("my-dataset", "a description").await?;
// Ingest one event
client.ingest(&dataset.name, vec![
json!({"foo": "bar"})
]).await?;
// Query the dataset
let query_res = client.query(r#"['my-dataset']"#, None).await?;
dbg!(query_res);
// Delete the dataset
client.datasets().delete(dataset.name).await?;
Ok(())
}
Re-exports§
pub use client::Client;
pub use client::RequestOptions;
pub use error::Error;
Modules§
- annotations
- Manage datasets, ingest data and query it.
- client
- The top-level client for the Axiom API.
- datasets
- Manage datasets, ingest data and query it.
- error
- Error type definitions.
- limits
- Rate-limit type definitions.
- users
- Manage users and roles.
Structs§
- Header
Map - A set of HTTP headers