pub struct FetchRequestBuilder { /* private fields */ }
Expand description

Builder for FetchRequest.

Implementations§

source§

impl FetchRequestBuilder

source

pub fn cluster_id(&mut self, value: Option<StrBytes>) -> &mut Self

The clusterId if known. This is used to validate metadata fetches prior to broker registration.

Supported API versions: 12-16

source

pub fn replica_id(&mut self, value: BrokerId) -> &mut Self

The broker ID of the follower, of -1 if this request is from a consumer.

Supported API versions: 0-14

source

pub fn replica_state(&mut self, value: ReplicaState) -> &mut Self

Supported API versions: 15-16

source

pub fn max_wait_ms(&mut self, value: i32) -> &mut Self

The maximum time in milliseconds to wait for the response.

Supported API versions: 0-16

source

pub fn min_bytes(&mut self, value: i32) -> &mut Self

The minimum bytes to accumulate in the response.

Supported API versions: 0-16

source

pub fn max_bytes(&mut self, value: i32) -> &mut Self

The maximum bytes to fetch. See KIP-74 for cases where this limit may not be honored.

Supported API versions: 3-16

source

pub fn isolation_level(&mut self, value: i8) -> &mut Self

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-16

source

pub fn session_id(&mut self, value: i32) -> &mut Self

The fetch session ID.

Supported API versions: 7-16

source

pub fn session_epoch(&mut self, value: i32) -> &mut Self

The fetch session epoch, which is used for ordering requests in a session.

Supported API versions: 7-16

source

pub fn topics(&mut self, value: Vec<FetchTopic>) -> &mut Self

The topics to fetch.

Supported API versions: 0-16

source

pub fn forgotten_topics_data(&mut self, value: Vec<ForgottenTopic>) -> &mut Self

In an incremental fetch request, the partitions to remove.

Supported API versions: 7-16

source

pub fn rack_id(&mut self, value: StrBytes) -> &mut Self

Rack ID of the consumer making this request

Supported API versions: 11-16

source

pub fn unknown_tagged_fields( &mut self, value: BTreeMap<i32, Bytes> ) -> &mut Self

Other tagged fields

source

pub fn build(&self) -> Result<FetchRequest, FetchRequestBuilderError>

Builds a new FetchRequest.

§Errors

If a required field has not been initialized.

Trait Implementations§

source§

impl Clone for FetchRequestBuilder

source§

fn clone(&self) -> FetchRequestBuilder

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for FetchRequestBuilder

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.