Expand description
Type-safe identifier newtypes for Grapsus proxy.
These types provide compile-time safety for identifiers, preventing accidental mixing of different ID types (e.g., passing a RouteId where an UpstreamId is expected).
§Scoped Identifiers
Grapsus supports hierarchical configuration through namespaces and services.
The Scope enum represents where a resource is defined, and QualifiedId
combines a local name with its scope for unambiguous identification.
use grapsus_common::ids::{Scope, QualifiedId};
// Global resource
let global = QualifiedId::global("shared-auth");
assert_eq!(global.canonical(), "shared-auth");
// Namespace-scoped resource
let namespaced = QualifiedId::namespaced("api", "backend");
assert_eq!(namespaced.canonical(), "api:backend");
// Service-scoped resource
let service = QualifiedId::in_service("api", "payments", "checkout");
assert_eq!(service.canonical(), "api:payments:checkout");Structs§
- AgentId
- Agent identifier.
- Correlation
Id - Unique correlation ID for request tracing across components.
- Qualified
Id - A qualified identifier combining a local name with its scope.
- Request
Id - Unique request ID for internal tracking.
- RouteId
- Route identifier.
- Upstream
Id - Upstream identifier.
Enums§
- Scope
- Represents where a resource is defined in the configuration hierarchy.