Struct fluvio_dataplane_protocol::batch::Batch
source · [−]pub struct Batch<R = MemoryRecords> {
pub base_offset: Offset,
pub batch_len: i32,
pub header: BatchHeader,
/* private fields */
}
Fields
base_offset: Offset
batch_len: i32
header: BatchHeader
Implementations
sourceimpl<R> Batch<R>
impl<R> Batch<R>
pub fn get_mut_header(&mut self) -> &mut BatchHeader
pub fn get_header(&self) -> &BatchHeader
pub fn own_records(self) -> R
pub fn records(&self) -> &R
pub fn mut_records(&mut self) -> &mut R
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 add_to_offset_delta(&mut self, delta: i32)
pub fn set_offset_delta(&mut self, delta: i32)
pub fn get_last_offset(&self) -> Offset
pub fn records_len(&self) -> usize
sourcepub fn get_last_offset_delta(&self) -> Size
👎 Deprecated since 0.9.2: use last_offset_delta instead
pub fn get_last_offset_delta(&self) -> Size
use last_offset_delta instead
get last offset delta
pub fn last_offset_delta(&self) -> i32
pub fn get_compression(&self) -> Result<Compression, CompressionError>
sourceimpl<R> Batch<R> where
R: Encoder,
impl<R> Batch<R> where
R: Encoder,
sourcepub fn validate_decoding(&self) -> bool
pub fn validate_decoding(&self) -> bool
check if batch is valid after decoded
sourceimpl<R: BatchRecords> Batch<R>
impl<R: BatchRecords> Batch<R>
sourcepub fn computed_last_offset(&self) -> Offset
pub fn computed_last_offset(&self) -> Offset
computed last offset which is base offset + number of records
sourceimpl Batch
impl Batch
sourcepub fn add_record(&mut self, record: Record)
pub fn add_record(&mut self, record: Record)
add new record, this will update the offset to correct
pub fn add_records(&mut self, records: &mut Vec<Record>)
pub fn update_offset_deltas(&mut self)
pub fn into_consumer_records_iter(
self,
partition: PartitionId
) -> impl Iterator<Item = ConsumerRecord>
sourceimpl Batch<RawRecords>
impl Batch<RawRecords>
pub fn memory_records(&self) -> Result<MemoryRecords, CompressionError>
Trait Implementations
sourceimpl<R> Decoder for Batch<R> where
R: BatchRecords,
impl<R> Decoder for Batch<R> where
R: BatchRecords,
sourceimpl<R> Encoder for Batch<R> where
R: BatchRecords,
impl<R> Encoder for Batch<R> where
R: BatchRecords,
sourceimpl<T: Into<MemoryRecords>> From<T> for Batch
impl<T: Into<MemoryRecords>> From<T> for Batch
sourceimpl TryFrom<Batch<RawRecords>> for Batch
impl TryFrom<Batch<RawRecords>> for Batch
type Error = CompressionError
type Error = CompressionError
The type returned in the event of a conversion error.
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more