Documentation

Rust Client

Connection — Rust Client

The jetgraph-client crate provides a typed, ergonomic API over gRPC. It is the recommended client for Rust applications that need the highest throughput and the lowest latency.

🦀
The Rust client is open source — source, issues, and release notes live at github.com/JetGraphEngine/JetGraphClient. The full JetGraphEngine organization hosts all official repositories.

Installation

Add the crate to your Cargo.toml:

toml — Cargo.toml
[dependencies] jetgraph-client = "*" tokio = { version = "1", features = ["full"] }

Minimal Working Example

rust
use jetgraph_client::{GraphClient, CreateEdgeRequest, VelocityQuery, prop}; #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { // Connect to the engine let graph = GraphClient::connect("http://localhost:50051").await?; // Lookup an existing node by external ID let card_id = graph.lookup_node("CARD", "card-001").await?; // Query velocity: how many TRANSACTS_AT edges in the last hour? let count = graph .get_velocity_count(VelocityQuery { node: card_id, edge_type: "TRANSACTS_AT".into(), window_secs: 3600, }) .await? .count; println!("Transactions in last hour: {}", count); Ok(()) }

Recommended Usage Pattern

For scoring workloads, follow the Query → Score → Insert three-phase pattern on every event:

💡
Always write the edge even on a declined event. The graph needs the full history to compute accurate velocity counts and risk propagation going forward.