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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//! Connection management and request dispatch for Apache Kafka in Rust.
//!
//! This crate provides the first I/O-doing layer of Crabka. It wraps
//! `crabka-protocol`'s typed request/response messages in a `tokio`-based
//! TCP client that:
//!
//! - Opens one connection per broker, multiplexing requests via
//! correlation ID.
//! - Negotiates API versions on connect.
//! - Manages a [`BrokerPool`] keyed on broker id with lazy connect.
//! - Resolves bootstrap addresses on builder.
//!
//! ## Quick start
//!
//! ```no_run
//! use crabka_client_core::Client;
//! use crabka_protocol::owned::api_versions_request::ApiVersionsRequest;
//!
//! # async fn run() -> Result<(), Box<dyn std::error::Error>> {
//! let client = Client::builder()
//! .bootstrap("localhost:9092")
//! .client_id("my-app")
//! .build()
//! .await?;
//!
//! let resp = client.send(ApiVersionsRequest::default()).await?;
//! println!("broker supports {} APIs", resp.api_keys.len());
//!
//! client.close();
//! # Ok(())
//! # }
//! ```
//!
//! ## Scope and boundaries
//!
//! This crate is the shared transport and request-dispatch layer. It provides
//! bootstrap resolution, API-version negotiation, broker-id connection pooling,
//! typed request/response dispatch, low-level fetch helpers, and client-side
//! TLS/SASL negotiation. Higher-level semantics — batching, idempotence,
//! consumer-group heartbeats, commits, admin retries, and transactions — live in
//! the producer, consumer, and admin crates built on top of this one.
//!
//! TLS / SASL: a client-side security surface lives in [`security`] and
//! [`sasl`] — set [`ConnectionOptions::security`] (or the `Client`
//! builder's `.security(...)`) to negotiate TLS then SASL before the
//! API-versions bootstrap. `None` (the default) is plaintext.
//!
//! ## Cargo features
//!
//! - `mock` — exposes `MockBroker` beyond `#[cfg(test)]` for downstream
//! testing.
pub use ;
pub use ;
pub use ClientError;
pub use ;
pub use ;
pub use ;
pub use ProtocolRequest;
pub use ;
pub use ;
pub use ApiVersionTable;
pub use MockBroker;