Rust Client — Getting Started

Open inAnthropic

Community contribution — incubating

The Rust client is maintained by ParapluOU — thank you to the community authors. It requires Rust nightly and is not yet published on crates.io.

Prerequisites

  • TerminusDB running locally — see Install guide
  • Rust nightly: rustup install nightly && rustup default nightly

Add the dependency

Example: toml
[dependencies]
terminusdb-client = { git = "https://github.com/ParapluOU/terminusdb-rs" }
tokio = { version = "1", features = ["full"] }
anyhow = "1"

Add a rust-toolchain.toml to your project root:

Example: toml
[toolchain]
channel = "nightly"

Connect

Set environment variables:

Example: Bash
export TERMINUSDB_HOST="http://localhost:6363"
export TERMINUSDB_USER="admin"
export TERMINUSDB_PASS="root"
Example: rust
use terminusdb_client::TerminusDBHttpClient;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let client = TerminusDBHttpClient::from_env().await?;
    println!("Connected to TerminusDB");
    Ok(())
}

Run with cargo run. You should see Connected to TerminusDB.

Next steps

Was this helpful?