PhyTrace Rust SDK¶
The PhyTrace Rust SDK provides a high-performance, type-safe toolkit for integrating autonomous systems with the PhyWare data platform.
Installation¶
Or add to Cargo.toml:
Features¶
- UDM Models — Strongly-typed Rust structs for all 23 UDM domains
- Event Builder — Fluent API for constructing UDM events
- Validation — Schema and business rule validation at the source
- Provenance — Cryptographic signing (HMAC-SHA256) for data integrity
- Transport — HTTP (default), with extensible transport trait
- Reliability — File-based buffering, exponential backoff retry, batching
- Agent — High-level orchestrator for production deployments
- Async — Built on Tokio for high-performance async I/O
Feature Flags¶
| Feature | Default | Description |
|---|---|---|
http | ✅ | HTTP transport via reqwest |
grpc | ❌ | gRPC transport (planned) |
mqtt | ❌ | MQTT transport (planned) |
websocket | ❌ | WebSocket transport (planned) |
full | ❌ | All transport features |
Quick Example¶
use phytrace_sdk::{UdmEvent, EventType, SourceType};
use phytrace_sdk::models::domains::{IdentityDomain, LocationDomain, Position2D};
fn main() {
let event = UdmEvent::new(SourceType::Amr)
.with_event_type(EventType::TelemetryPeriodic)
.with_identity(IdentityDomain {
source_id: Some("robot-001".to_string()),
fleet_id: Some("warehouse-fleet".to_string()),
..Default::default()
})
.with_location(LocationDomain {
position_2d: Some(Position2D { x: 10.5, y: 20.3 }),
heading_rad: Some(1.57),
..Default::default()
});
let json = event.to_json_pretty().unwrap();
println!("{}", json);
}
Contents¶
- Quickstart — Get up and running in 5 minutes
- API Reference — Full API documentation
- UDM Models — Domain model reference (via docs.rs)
- Transport Layer — HTTP and custom transports (via docs.rs)
- Reliability — Buffering, retry, circuit breaker (via docs.rs)
- Agent Configuration — Configuration reference
- Examples — Code examples
- Changelog — Version history
Requirements¶
- Rust 1.75+
- Tokio runtime