pub struct ConsumerRecords {
pub topic: String,
pub partition: i32,
pub batches: Vec<LeanBatch>,
pub fallback: Vec<Record>,
}Expand description
What one partition yielded.
Fields§
§topic: String§partition: i32§batches: Vec<LeanBatch>The batches as barnabas_core::records read them.
fallback: Vec<Record>Records from a batch the lean reader handed back — only a pre-magic-2
batch does — decoded the ordinary way. Kept separate rather than
converted, because building a LeanBatch from decoded records would
mean re-serialising them.
Implementations§
Source§impl ConsumerRecords
impl ConsumerRecords
Sourcepub fn iter(&self) -> impl Iterator<Item = RecordRef<'_>>
pub fn iter(&self) -> impl Iterator<Item = RecordRef<'_>>
Every record, whichever path decoded it.
This is what callers should use. Records live in batches because that is how the format stores them and how the filtering works, but a caller almost never cares which batch a record came from — and having to nest two loops, plus handle the fallback, would be a bad trade for the speed it buys.
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConsumerRecords
impl RefUnwindSafe for ConsumerRecords
impl Send for ConsumerRecords
impl Sync for ConsumerRecords
impl Unpin for ConsumerRecords
impl UnsafeUnpin for ConsumerRecords
impl UnwindSafe for ConsumerRecords
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