Skip to main content

krabka_schema_serde/
lib.rs

1//! Confluent-compatible schema serdes for Krabka clients.
2//!
3//! This crate frames payloads as `magic(0x00) | schema_id(4 BE) | body`. A
4//! Protobuf payload also carries a message-index. The crate registers schemas
5//! with a Confluent-compatible Schema Registry and resolves them from it. The
6//! typed serializers here do not depend on one client: `krabka-client-streams`
7//! bridges them now, and other clients can bridge them later.
8
9pub mod cache;
10pub mod error;
11pub mod registry;
12pub mod subject;
13pub mod wire;
14
15pub mod format;
16
17pub use cache::{
18    CacheConfig, DEFAULT_SCHEMA_FETCH_RETRY_INITIAL_BACKOFF,
19    DEFAULT_SCHEMA_FETCH_RETRY_MAX_BACKOFF, RegisterMode, SchemaCache, SchemaFetchRetryPolicy,
20    default_registry, set_default_registry,
21};
22pub use error::SchemaSerdeError;
23#[cfg(feature = "avro")]
24pub use format::avro::AvroSerde;
25#[cfg(feature = "json")]
26pub use format::json::JsonSerde;
27#[cfg(feature = "protobuf")]
28pub use format::protobuf::ProtobufSerde;
29pub use format::validate::validate_body;
30#[cfg(feature = "protobuf")]
31pub use format::validate::validate_protobuf_with_references;
32pub use registry::{RegistryClient, model::SchemaReference};
33pub use subject::{Role, SchemaKind, SubjectStrategy, TopicNameStrategy};