pub struct Batch<R>where
R: BatchRecords,{
pub base_offset: Offset,
pub batch_len: i32,
pub header: BatchHeader,
pub records: R,
}
Fields§
§base_offset: Offset
§batch_len: i32
§header: BatchHeader
§records: R
Implementations§
Source§impl<R> Batch<R>where
R: BatchRecords,
impl<R> Batch<R>where
R: BatchRecords,
pub fn get_mut_header(&mut self) -> &mut BatchHeader
pub fn get_header(&self) -> &BatchHeader
pub fn get_base_offset(&self) -> Offset
pub fn set_base_offset(&mut self, offset: Offset)
pub fn base_offset(self, offset: Offset) -> Self
pub fn set_offset_delta(&mut self, delta: i32)
pub fn get_last_offset(&self) -> Offset
Sourcepub fn get_last_offset_delta(&self) -> Size
pub fn get_last_offset_delta(&self) -> Size
get last offset delta
Source§impl Batch<DefaultBatchRecords>
impl Batch<DefaultBatchRecords>
Sourcepub fn add_record(&mut self, record: DefaultRecord)
pub fn add_record(&mut self, record: DefaultRecord)
add new record, this will update the offset to correct
Trait Implementations§
Source§impl<R> Decoder for Batch<R>where
R: BatchRecords,
impl<R> Decoder for Batch<R>where
R: BatchRecords,
Source§impl<R> Encoder for Batch<R>where
R: BatchRecords,
impl<R> Encoder for Batch<R>where
R: BatchRecords,
Auto Trait Implementations§
impl<R> Freeze for Batch<R>where
R: Freeze,
impl<R> RefUnwindSafe for Batch<R>where
R: RefUnwindSafe,
impl<R> Send for Batch<R>where
R: Send,
impl<R> Sync for Batch<R>where
R: Sync,
impl<R> Unpin for Batch<R>where
R: Unpin,
impl<R> UnwindSafe for Batch<R>where
R: UnwindSafe,
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