Skip to main content

types_registry_sdk/
lib.rs

1//! Types Registry SDK
2//!
3//! This crate provides the public API for the `types-registry` module:
4//! - `TypesRegistryClient` trait for inter-module communication
5//! - `GtsTypeSchema` / `GtsInstance` typed entity models
6//! - `TypeSchemaQuery` / `InstanceQuery` for filtering
7//! - `GtsTypeId` / `GtsInstanceId` typed identifiers
8//! - `TypesRegistryError` for error handling
9//!
10//! ## Usage
11//!
12//! Consumers obtain the client from `ClientHub`:
13//! ```ignore
14//! use types_registry_sdk::{TypeSchemaQuery, TypesRegistryClient};
15//!
16//! let client = hub.get::<dyn TypesRegistryClient>()?;
17//!
18//! let schema = client.get_type_schema("gts.acme.core.events.user.v1~").await?;
19//! let schemas = client
20//!     .list_type_schemas(TypeSchemaQuery::default().with_pattern("gts.acme.*"))
21//!     .await?;
22//! ```
23
24#![forbid(unsafe_code)]
25#![deny(rust_2018_idioms)]
26
27pub mod api;
28pub mod error;
29pub mod models;
30
31#[cfg(feature = "test-util")]
32pub mod testing;
33
34pub use api::TypesRegistryClient;
35pub use error::TypesRegistryError;
36pub use models::{
37    GtsInstance, GtsTypeId, GtsTypeSchema, InstanceQuery, RegisterResult, RegisterSummary,
38    TypeSchemaQuery, is_type_schema_id,
39};
40
41// Re-export the underlying gts identifier types so consumers don't need a
42// direct dependency on `gts` for typed IDs.
43pub use gts::GtsInstanceId;