observer-rust
observer-rust is the low-level Rust runtime surface for defining Observer-compatible test registries.
It is intentionally small. This crate does not provide macros or a human-first authoring DSL. Instead, it exposes the deterministic registration and execution types that higher-level Rust integrations build on.
What It Provides
TestContextfor collecting stdout, stderr, exit code, and telemetryTestOutcomeand telemetry value typesTestRegistrationfor explicit test registrationRegistryfor publishing a static test set to Observersorted_validated_testsfor deterministic ordering and duplicate checks
When To Use It
Use observer-rust if you are:
- building your own Rust-facing test authoring layer
- generating Rust registrations mechanically
- integrating Rust tests into a custom provider host
If you want a ready-made provider host CLI, pair this crate with observer-rust-host.
If you want a higher-level authoring library with macros and starter projects, use observer-rust-lib.
Minimal Example
use ;
;
Before a registry is exposed to Observer, call sorted_validated_tests::<YourRegistry>() to enforce the crate's deterministic rules.
Determinism Rules
- canonical test names must be non-empty
- targets must be non-empty
- canonical names must be unique
- targets must be unique
- final ordering is canonical-name bytes, then target bytes
Those rules are enforced by sorted_validated_tests so provider hosts can rely on a stable contract.