pub enum Response {
Show 37 variants
Authenticated {
session_id: String,
expires_in: u64,
},
ScramServerFirst {
message: Bytes,
},
ScramServerFinal {
message: Bytes,
session_id: Option<String>,
expires_in: Option<u64>,
},
Published {
offset: u64,
partition: u32,
},
Messages {
messages: Vec<MessageData>,
},
TopicCreated {
name: String,
partitions: u32,
},
Topics {
topics: Vec<String>,
},
TopicDeleted,
OffsetCommitted,
Offset {
offset: Option<u64>,
},
Metadata {
name: String,
partitions: u32,
},
ClusterMetadata {
controller_id: Option<String>,
brokers: Vec<BrokerInfo>,
topics: Vec<TopicMetadata>,
},
SchemaRegistered {
id: i32,
},
Schema {
id: i32,
schema: String,
},
Pong,
OffsetBounds {
earliest: u64,
latest: u64,
},
Groups {
groups: Vec<String>,
},
GroupDescription {
consumer_group: String,
offsets: HashMap<String, HashMap<u32, u64>>,
},
GroupDeleted,
OffsetForTimestamp {
offset: Option<u64>,
},
Error {
message: String,
},
Ok,
ProducerIdInitialized {
producer_id: u64,
producer_epoch: u16,
},
IdempotentPublished {
offset: u64,
partition: u32,
duplicate: bool,
},
TransactionStarted {
txn_id: String,
},
PartitionsAddedToTxn {
txn_id: String,
partition_count: usize,
},
TransactionalPublished {
offset: u64,
partition: u32,
sequence: i32,
},
OffsetsAddedToTxn {
txn_id: String,
},
TransactionCommitted {
txn_id: String,
},
TransactionAborted {
txn_id: String,
},
QuotasDescribed {
entries: Vec<QuotaEntry>,
},
QuotasAltered {
altered_count: usize,
},
Throttled {
throttle_time_ms: u64,
quota_type: String,
entity: String,
},
TopicConfigAltered {
topic: String,
changed_count: usize,
},
PartitionsCreated {
topic: String,
new_partition_count: u32,
},
RecordsDeleted {
topic: String,
results: Vec<DeleteRecordsResult>,
},
TopicConfigsDescribed {
configs: Vec<TopicConfigDescription>,
},
}Expand description
Protocol response messages
§Stability
WARNING: Variant order must remain stable for postcard serialization compatibility. Adding new variants should only be done at the end of the enum.
Variants§
Authenticated
Authentication successful
Fields
ScramServerFirst
SCRAM-SHA-256: Server-first message (challenge)
ScramServerFinal
SCRAM-SHA-256: Server-final message (verification or error)
Fields
Published
Success response with offset
Messages
Messages response
Fields
messages: Vec<MessageData>TopicCreated
Topic created
Topics
List of topics
TopicDeleted
Topic deleted
OffsetCommitted
Offset committed
Offset
Offset response
Metadata
Metadata
ClusterMetadata
Full cluster metadata for topic(s)
SchemaRegistered
Schema registration result
Schema
Schema details
Pong
Pong
OffsetBounds
Offset bounds for a partition
Groups
List of consumer groups
GroupDescription
Consumer group details with all offsets
GroupDeleted
Consumer group deleted
OffsetForTimestamp
Offset for a timestamp
Fields
Error
Error response
Ok
Success
ProducerIdInitialized
Producer ID initialized
Fields
IdempotentPublished
Idempotent publish result
Fields
TransactionStarted
Transaction started successfully
PartitionsAddedToTxn
Partitions added to transaction
TransactionalPublished
Transactional publish result
Fields
OffsetsAddedToTxn
Offsets added to transaction
TransactionCommitted
Transaction committed
TransactionAborted
Transaction aborted
QuotasDescribed
Quota descriptions
Fields
entries: Vec<QuotaEntry>List of quota entries
QuotasAltered
Quotas altered successfully
Throttled
Throttle response (returned when quota exceeded)
Fields
TopicConfigAltered
Topic configuration altered
PartitionsCreated
Partitions created
RecordsDeleted
Records deleted
TopicConfigsDescribed
Topic configurations described
Fields
configs: Vec<TopicConfigDescription>Configuration descriptions per topic
Implementations§
Source§impl Response
impl Response
Sourcepub fn from_bytes(data: &[u8]) -> Result<Response, ProtocolError>
pub fn from_bytes(data: &[u8]) -> Result<Response, ProtocolError>
Deserialize response from bytes