mz_ccsr/
lib.rs

1// Copyright Materialize, Inc. and contributors. All rights reserved.
2//
3// Use of this software is governed by the Business Source License
4// included in the LICENSE file.
5//
6// As of the Change Date specified in that file, in accordance with
7// the Business Source License, use of this software will be governed
8// by the Apache License, Version 2.0.
9
10#![warn(missing_debug_implementations)]
11
12//! The `ccsr` crate provides an ergonomic API client for Confluent-compatible
13//! schema registries (CCSRs).
14//!
15//! The only known CCSR implementation is the [Confluent Schema Registry], but
16//! this crate is compatible with any implementation that adheres to the
17//! CCSR [API specification].
18//!
19//! ## Example usage
20//!
21//! ```no_run
22//! # async {
23//! use mz_ccsr::ClientConfig;
24//!
25//! let url = "http://localhost:8080".parse()?;
26//! let client = ClientConfig::new(url).build()?;
27//! let subjects = client.list_subjects().await?;
28//! for subject in subjects {
29//!     let schema = client.get_schema_by_subject(&subject).await?;
30//!     // Do something with `schema`.
31//! }
32//! # Ok::<_, Box<dyn std::error::Error>>(())
33//! # };
34//! ```
35//!
36//!
37//! [API specification]: https://docs.confluent.io/current/schema-registry/develop/api.html
38//! [Confluent Schema Registry]: https://docs.confluent.io/current/schema-registry/index.html
39
40mod client;
41mod config;
42
43pub mod tls;
44
45pub use client::*;
46pub use config::ClientConfig;
47pub use reqwest::Proxy;