Expand description
Core data model for osproxy.
This crate is the shared vocabulary every other crate speaks. It has no
I/O dependencies (no async runtime, no sockets, no wire serialization) so
the surface an SPI implementer compiles against stays tiny and fast, see
docs/01-architecture.md §2.
It contains three things:
ids, strongly-typed identifier newtypes (no bareString/u64identifiers cross API boundaries,docs/08§7).endpoint, theendpoint::EndpointKindclassification of OpenSearch requests (docs/02§5).error, the request-patherror::ErrorContexttaxonomy that makes every failure typed, contextual, and LLM-diagnosable (docs/02§4).time, thetime::Clockseam that keeps time deterministic and testable (docs/12).target, thetarget::Targeta routing decision resolves to (docs/02).trace, thetrace::TraceContextW3C propagation primitive that carries distributed-trace identity to downstream calls (docs/05§2).json, a dependency-free byte-level JSON scanner that reads partition keys and id components straight from a body without materializing a tree (ADR-014), shared by the SPI extraction utilities and the transform layer.
The module tree is intentionally flat and small; each concept lives in its
own file (docs/08 §2).
Re-exports§
pub use cursor::CursorSigner;pub use endpoint::EndpointKind;pub use error::ErrorCode;pub use error::ErrorContext;pub use ids::ClusterId;pub use ids::Epoch;pub use ids::FieldName;pub use ids::IndexName;pub use ids::PartitionId;pub use ids::PrincipalId;pub use ids::RequestId;pub use json::JsonError;pub use target::Target;pub use time::Clock;pub use time::Instant;pub use time::ManualClock;pub use time::SystemClock;pub use trace::TraceContext;
Modules§
- cursor
- Stateless cursor-affinity envelope (
docs/03§6). - endpoint
- Classification of OpenSearch requests into handling categories.
- error
- The request-path error taxonomy.
- ids
- Strongly-typed identifier newtypes.
- json
- Byte-level JSON scanning for the no-materialization body path (ADR-014).
- target
- Where a routed request is sent.
- time
- The clock seam, the foundation of deterministic time.
- trace
- W3C Trace Context propagation, the identifiers the proxy continues from an
incoming request and forwards to every downstream call so the upstream’s
spans join the same distributed trace (
docs/05§2,OTel).