pub struct ConsumerConfig {
pub name: String,
pub max_batch_size: usize,
pub max_batch_latency: Duration,
pub checkpoint_name: Option<String>,
pub filter: Option<Box<dyn Fn(&Value) -> Result<bool> + Send>>,
}Expand description
Per-consumer batching, checkpoint, and filter configuration.
Fields§
§name: StringA name that identifies this consumer. Returned by
LogBatch::consumer_name.
max_batch_size: usizeMaximum number of records per batch.
max_batch_latency: DurationMaximum time to wait for a partial batch to fill before yielding it.
checkpoint_name: Option<String>If set, enables checkpoint persistence with this name.
The checkpoint file will be stored as .<name> in the log directory.
filter: Option<Box<dyn Fn(&Value) -> Result<bool> + Send>>Optional filter applied to each record. If the filter returns
Ok(false) the record is not added to this consumer’s batch.
Implementations§
Source§impl ConsumerConfig
impl ConsumerConfig
Auto Trait Implementations§
impl Freeze for ConsumerConfig
impl !RefUnwindSafe for ConsumerConfig
impl Send for ConsumerConfig
impl !Sync for ConsumerConfig
impl Unpin for ConsumerConfig
impl !UnwindSafe for ConsumerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more