axiom-rs 0.1.0

A Rust SDK for Axiom
Documentation

axiom-rs

CI crates.io docs.rs License

The Rust SDK for Axiom — manage datasets, ingest and query data all from your Rust project.

Install

Add the following to your Cargo.toml:

[dependencies]
axiom-rs = "0.1"

Get started

This library uses Tokio by default, so your Cargo.toml could look like this:

[dependencies]
axiom-rs = "0.1"
tokio = "1"

If you want to use async-std, you need to set some features:

[dependencies] 
axiom-rs = { version = "0.1", default-features = false, features = ["async-std"] }
async-std = "1"

And your src/main.rs like this:

use axiom_rs::Client;

#[tokio::main] // or #[async_std::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
  let client = Client::new()?;
  let datasets = client.datasets.list().await?;
  println!("{:?}", datasets);
  Ok(())
}

Note: The Client constructor uses AXIOM_TOKEN and other parameters from your environment by default. See the Client documentation for other options.

Optional Features

The following are a list of Cargo features that can be enabled or disabled:

  • default-tls (enabled by default): Provides TLS support to connect over HTTPS.
  • native-tls: Enables TLS functionality provided by native-tls.
  • rustls-tls: Enables TLS functionality provided by rustls.
  • tokio (enabled by default): Enables the usage with the tokio runtime.
  • async-std : Enables the usage with the async-std runtime.

License

Licensed under either of

at your option.