#[non_exhaustive]pub struct FetchRequest {Show 13 fields
pub cluster_id: Option<StrBytes>,
pub replica_id: BrokerId,
pub replica_state: ReplicaState,
pub max_wait_ms: i32,
pub min_bytes: i32,
pub max_bytes: i32,
pub isolation_level: i8,
pub session_id: i32,
pub session_epoch: i32,
pub topics: Vec<FetchTopic>,
pub forgotten_topics_data: Vec<ForgottenTopic>,
pub rack_id: StrBytes,
pub unknown_tagged_fields: BTreeMap<i32, Bytes>,
}
Expand description
Valid versions: 0-17
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.cluster_id: Option<StrBytes>
The clusterId if known. This is used to validate metadata fetches prior to broker registration.
Supported API versions: 12-17
replica_id: BrokerId
The broker ID of the follower, of -1 if this request is from a consumer.
Supported API versions: 0-14
replica_state: ReplicaState
Supported API versions: 15-17
max_wait_ms: i32
The maximum time in milliseconds to wait for the response.
Supported API versions: 0-17
min_bytes: i32
The minimum bytes to accumulate in the response.
Supported API versions: 0-17
max_bytes: i32
The maximum bytes to fetch. See KIP-74 for cases where this limit may not be honored.
Supported API versions: 3-17
isolation_level: i8
This setting controls the visibility of transactional records. Using READ_UNCOMMITTED (isolation_level = 0) makes all records visible. With READ_COMMITTED (isolation_level = 1), non-transactional and COMMITTED transactional records are visible. To be more concrete, READ_COMMITTED returns all data from offsets smaller than the current LSO (last stable offset), and enables the inclusion of the list of aborted transactions in the result, which allows consumers to discard ABORTED transactional records
Supported API versions: 4-17
session_id: i32
The fetch session ID.
Supported API versions: 7-17
session_epoch: i32
The fetch session epoch, which is used for ordering requests in a session.
Supported API versions: 7-17
topics: Vec<FetchTopic>
The topics to fetch.
Supported API versions: 0-17
forgotten_topics_data: Vec<ForgottenTopic>
In an incremental fetch request, the partitions to remove.
Supported API versions: 7-17
rack_id: StrBytes
Rack ID of the consumer making this request
Supported API versions: 11-17
unknown_tagged_fields: BTreeMap<i32, Bytes>
Other tagged fields
Implementations§
Source§impl FetchRequest
impl FetchRequest
Sourcepub fn with_cluster_id(self, value: Option<StrBytes>) -> Self
pub fn with_cluster_id(self, value: Option<StrBytes>) -> Self
Sets cluster_id
to the passed value.
The clusterId if known. This is used to validate metadata fetches prior to broker registration.
Supported API versions: 12-17
Sourcepub fn with_replica_id(self, value: BrokerId) -> Self
pub fn with_replica_id(self, value: BrokerId) -> Self
Sets replica_id
to the passed value.
The broker ID of the follower, of -1 if this request is from a consumer.
Supported API versions: 0-14
Sourcepub fn with_replica_state(self, value: ReplicaState) -> Self
pub fn with_replica_state(self, value: ReplicaState) -> Self
Sets replica_state
to the passed value.
Supported API versions: 15-17
Sourcepub fn with_max_wait_ms(self, value: i32) -> Self
pub fn with_max_wait_ms(self, value: i32) -> Self
Sets max_wait_ms
to the passed value.
The maximum time in milliseconds to wait for the response.
Supported API versions: 0-17
Sourcepub fn with_min_bytes(self, value: i32) -> Self
pub fn with_min_bytes(self, value: i32) -> Self
Sets min_bytes
to the passed value.
The minimum bytes to accumulate in the response.
Supported API versions: 0-17
Sourcepub fn with_max_bytes(self, value: i32) -> Self
pub fn with_max_bytes(self, value: i32) -> Self
Sets max_bytes
to the passed value.
The maximum bytes to fetch. See KIP-74 for cases where this limit may not be honored.
Supported API versions: 3-17
Sourcepub fn with_isolation_level(self, value: i8) -> Self
pub fn with_isolation_level(self, value: i8) -> Self
Sets isolation_level
to the passed value.
This setting controls the visibility of transactional records. Using READ_UNCOMMITTED (isolation_level = 0) makes all records visible. With READ_COMMITTED (isolation_level = 1), non-transactional and COMMITTED transactional records are visible. To be more concrete, READ_COMMITTED returns all data from offsets smaller than the current LSO (last stable offset), and enables the inclusion of the list of aborted transactions in the result, which allows consumers to discard ABORTED transactional records
Supported API versions: 4-17
Sourcepub fn with_session_id(self, value: i32) -> Self
pub fn with_session_id(self, value: i32) -> Self
Sets session_id
to the passed value.
The fetch session ID.
Supported API versions: 7-17
Sourcepub fn with_session_epoch(self, value: i32) -> Self
pub fn with_session_epoch(self, value: i32) -> Self
Sets session_epoch
to the passed value.
The fetch session epoch, which is used for ordering requests in a session.
Supported API versions: 7-17
Sourcepub fn with_topics(self, value: Vec<FetchTopic>) -> Self
pub fn with_topics(self, value: Vec<FetchTopic>) -> Self
Sets topics
to the passed value.
The topics to fetch.
Supported API versions: 0-17
Sourcepub fn with_forgotten_topics_data(self, value: Vec<ForgottenTopic>) -> Self
pub fn with_forgotten_topics_data(self, value: Vec<ForgottenTopic>) -> Self
Sets forgotten_topics_data
to the passed value.
In an incremental fetch request, the partitions to remove.
Supported API versions: 7-17
Sourcepub fn with_rack_id(self, value: StrBytes) -> Self
pub fn with_rack_id(self, value: StrBytes) -> Self
Sets rack_id
to the passed value.
Rack ID of the consumer making this request
Supported API versions: 11-17
Sourcepub fn with_unknown_tagged_fields(self, value: BTreeMap<i32, Bytes>) -> Self
pub fn with_unknown_tagged_fields(self, value: BTreeMap<i32, Bytes>) -> Self
Sets unknown_tagged_fields to the passed value.
Sourcepub fn with_unknown_tagged_field(self, key: i32, value: Bytes) -> Self
pub fn with_unknown_tagged_field(self, key: i32, value: Bytes) -> Self
Inserts an entry into unknown_tagged_fields.
Trait Implementations§
Source§impl Clone for FetchRequest
impl Clone for FetchRequest
Source§fn clone(&self) -> FetchRequest
fn clone(&self) -> FetchRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for FetchRequest
impl Debug for FetchRequest
Source§impl Decodable for FetchRequest
Available on crate feature broker
only.
impl Decodable for FetchRequest
broker
only.Source§impl Default for FetchRequest
impl Default for FetchRequest
Source§impl Encodable for FetchRequest
Available on crate feature client
only.
impl Encodable for FetchRequest
client
only.Source§impl From<FetchRequest> for RequestKind
Available on crate feature messages_enums
only.
impl From<FetchRequest> for RequestKind
messages_enums
only.Source§fn from(value: FetchRequest) -> RequestKind
fn from(value: FetchRequest) -> RequestKind
Source§impl HeaderVersion for FetchRequest
impl HeaderVersion for FetchRequest
Source§fn header_version(version: i16) -> i16
fn header_version(version: i16) -> i16
Source§impl Message for FetchRequest
impl Message for FetchRequest
Source§const VERSIONS: VersionRange
const VERSIONS: VersionRange
Source§const DEPRECATED_VERSIONS: Option<VersionRange>
const DEPRECATED_VERSIONS: Option<VersionRange>
Source§impl PartialEq for FetchRequest
impl PartialEq for FetchRequest
Source§impl Request for FetchRequest
Available on crate features client
and broker
only.
impl Request for FetchRequest
client
and broker
only.