Skip to main content

confluent_kafka/common/
mod.rs

1// Copyright 2025 Confluent Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Common types and utilities for Kafka (org.apache.kafka.common)
16
17pub mod acl;
18mod classic_group_state;
19mod cluster;
20mod cluster_resource;
21mod cluster_resource_listener;
22pub(crate) mod compress;
23pub mod config;
24mod election_type;
25// `pub(crate)` rather than private: `kafka_error_type!` and
26// `message_only_error!` expand `$crate::common::error::ErrorSource` and eight
27// similar absolute paths at every one of their ~150 call sites, so the module
28// has to be nameable crate-wide. The types it holds are still reached through
29// the re-exports below (CLAUDE.md §2).
30pub(crate) mod error;
31/// Kafka's exception classes (`org.apache.kafka.common.errors`).
32pub mod errors;
33pub(crate) mod feature;
34mod group_state;
35mod group_type;
36pub mod header;
37pub(crate) mod internals;
38mod invalid_record_error;
39mod isolation_level;
40mod kafka_error;
41pub mod kafka_future;
42mod local_callback_error;
43mod local_concurrent_modification_error;
44mod local_illegal_argument_error;
45mod local_illegal_state_error;
46mod local_timeout_error;
47mod local_unsupported_operation_error;
48pub(crate) mod memory;
49#[cfg(test)]
50mod message;
51mod metric;
52mod metric_name;
53mod metric_name_template;
54pub mod metrics;
55pub(crate) mod network;
56mod node;
57mod partition_info;
58pub(crate) mod protocol;
59pub mod quota;
60pub mod record;
61pub(crate) mod requests;
62pub mod resource;
63pub mod security;
64pub mod serialization;
65pub mod topic_collection;
66mod topic_id_partition;
67mod topic_partition;
68mod topic_partition_info;
69mod topic_partition_replica;
70pub(crate) mod utils;
71mod uuid;
72
73pub use classic_group_state::ClassicGroupState;
74pub use cluster::Cluster;
75pub use cluster_resource::ClusterResource;
76pub use cluster_resource_listener::ClusterResourceListener;
77pub use election_type::ElectionType;
78pub use error::Error;
79pub use group_state::GroupState;
80pub use group_type::GroupType;
81pub use invalid_record_error::InvalidRecordError;
82pub use isolation_level::IsolationLevel;
83// `ErrorHierarchy` is deliberately NOT re-exported: it is the mechanism behind
84// `Error`'s predicates, used only inside `error.rs` and by the error payloads
85// that declare their own ancestry. Callers — in-crate, external, and the C FFI
86// alike — use the inherent methods on `Error`.
87pub use kafka_error::KafkaError;
88pub use kafka_future::KafkaFuture;
89pub(crate) use kafka_future::{CompletionCallback, KafkaFutureOps};
90// The five JDK classes the client raises itself. Re-exported here rather than
91// from `common::errors`, which is Java's `org.apache.kafka.common.errors`
92// package and holds none of them.
93pub use local_concurrent_modification_error::LocalConcurrentModificationError;
94pub use local_illegal_argument_error::LocalIllegalArgumentError;
95pub use local_illegal_state_error::LocalIllegalStateError;
96pub use local_timeout_error::LocalTimeoutError;
97pub use local_unsupported_operation_error::LocalUnsupportedOperationError;
98// A binding's foreign callback error; no Java class (see its module doc).
99pub use local_callback_error::LocalCallbackError;
100pub use metric::{Metric, MetricValue};
101pub use metric_name::MetricName;
102pub use metric_name_template::MetricNameTemplate;
103pub use node::Node;
104pub use partition_info::PartitionInfo;
105pub use topic_collection::TopicCollection;
106pub use topic_id_partition::TopicIdPartition;
107pub use topic_partition::TopicPartition;
108pub use topic_partition_info::TopicPartitionInfo;
109pub use topic_partition_replica::TopicPartitionReplica;
110pub use uuid::Uuid;