1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//! Metadata, routing, connection pooling and the error taxonomy.
//!
//! This is the layer that knows what a cluster looks like. Everything above it
//! — admin RPCs, the read path — sends through [`Cluster`], which resolves the
//! right broker, retries on the errors that mean "your view is stale", and
//! keeps an immutable snapshot readers can take without blocking.
//!
//! # The two tables
//!
//! [`routing`] and the error taxonomy are first-class artifacts, each in one
//! file, because both encode knowledge that is otherwise scattered into
//! individual call sites and then quietly diverges.
//!
//! The error table lives in `kafka-conn` — [`ErrorCode`], [`Error`] — and is
//! re-exported here so the two sit together at the layer that acts on them.
//! It has to be defined down there because every crate in the workspace,
//! including the connection layer itself, needs to classify a broker's answer,
//! and a workspace with two error types would push a `From` conversion into
//! every call site.
//!
//! ```no_run
//! # async fn example() -> kafka_meta::Result<()> {
//! use kafka_meta::{Cluster, ClusterConfig};
//!
//! let cluster = Cluster::connect(["localhost:9092"], ClusterConfig::default()).await?;
//! let snapshot = cluster.snapshot();
//! println!(
//! "{} brokers, fetched {:?} ago",
//! snapshot.brokers().len(),
//! snapshot.age()
//! );
//!
//! let leader = cluster.leader_for("orders", 0).await?;
//! let coordinator = cluster.coordinator_for("my-group").await?;
//! # Ok(())
//! # }
//! ```
pub use ;
pub use ;
pub use RetryPolicy;
pub use ;
pub use ;
/// The error taxonomy, re-exported.
///
/// One type across the workspace: see the crate docs for why it is defined a
/// layer down.
pub use ;