pub trait ConsumerStream: Stream<Item = Result<ConsumerRecord, ErrorCode>> + Unpin {
// Required methods
fn offset_commit(&mut self) -> ConsumerBoxFuture<'_>;
fn offset_flush(&mut self) -> ConsumerBoxFuture<'_>;
}Expand description
Extension of Stream trait with offset management capabilities.
Required Methods§
Sourcefn offset_commit(&mut self) -> ConsumerBoxFuture<'_>
fn offset_commit(&mut self) -> ConsumerBoxFuture<'_>
Mark the offset of the last yelded record as committed. Depending on OffsetManagementStrategy
it may require a subsequent offset_flush() call to take any effect.
Sourcefn offset_flush(&mut self) -> ConsumerBoxFuture<'_>
fn offset_flush(&mut self) -> ConsumerBoxFuture<'_>
Send the committed offset to the server. The method waits for the server’s acknowledgment before it finishes.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl ConsumerStream for Pin<Box<dyn ConsumerStream + Send>>
Available on non-WebAssembly only.
impl ConsumerStream for Pin<Box<dyn ConsumerStream + Send>>
Available on non-WebAssembly only.