pub struct RecordBatchEncoder;
Expand description
Batch encoder for Kafka records.
Implementations§
Source§impl RecordBatchEncoder
impl RecordBatchEncoder
Sourcepub fn encode<'a, B, I>(
buf: &mut B,
records: I,
options: &RecordEncodeOptions,
) -> Result<()>
pub fn encode<'a, B, I>( buf: &mut B, records: I, options: &RecordEncodeOptions, ) -> Result<()>
Encode records into given buffer, using provided encoding options that select the encoding strategy based on version.
Sourcepub fn encode_with_custom_compression<'a, B, I, CF>(
buf: &mut B,
records: I,
options: &RecordEncodeOptions,
compressor: Option<CF>,
) -> Result<()>where
B: ByteBufMut,
I: IntoIterator<Item = &'a Record>,
I::IntoIter: Clone,
CF: Fn(&mut BytesMut, &mut B, Compression) -> Result<()>,
pub fn encode_with_custom_compression<'a, B, I, CF>(
buf: &mut B,
records: I,
options: &RecordEncodeOptions,
compressor: Option<CF>,
) -> Result<()>where
B: ByteBufMut,
I: IntoIterator<Item = &'a Record>,
I::IntoIter: Clone,
CF: Fn(&mut BytesMut, &mut B, Compression) -> Result<()>,
Encode records into given buffer, using provided encoding options that select the encoding strategy based on version.
§Arguments
compressor
- A function that compresses the given batch of records.
If None
, the right compression algorithm will automatically be selected and applied.
Trait Implementations§
Source§impl Clone for RecordBatchEncoder
impl Clone for RecordBatchEncoder
Source§fn clone(&self) -> RecordBatchEncoder
fn clone(&self) -> RecordBatchEncoder
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for RecordBatchEncoder
impl RefUnwindSafe for RecordBatchEncoder
impl Send for RecordBatchEncoder
impl Sync for RecordBatchEncoder
impl Unpin for RecordBatchEncoder
impl UnwindSafe for RecordBatchEncoder
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