pub struct ProtobufEncoder { /* private fields */ }Expand description
Protobuf Encoder
Implementations§
Source§impl ProtobufEncoder
impl ProtobufEncoder
pub fn new( options: ProtobufEncoderOptions, message_descriptor: MessageDescriptor, ) -> Self
Trait Implementations§
Source§impl Encoder for ProtobufEncoder
impl Encoder for ProtobufEncoder
Source§fn encode(&self, batch: &EventBatch) -> EncodeResult<Bytes>
fn encode(&self, batch: &EventBatch) -> EncodeResult<Bytes>
Encodes a single
EventBatch into a single byte stream.
This is typically used for batch-oriented sinks like S3 or GCS.Source§fn encode_individual(&self, batch: &EventBatch) -> Result<Vec<Bytes>, Error>
fn encode_individual(&self, batch: &EventBatch) -> Result<Vec<Bytes>, Error>
Encodes an
EventBatch into multiple independent byte streams (one per event).
This is typically used for message-oriented sinks like Kafka.
Default implementation just returns a single Vec with the output of encode.Auto Trait Implementations§
impl Freeze for ProtobufEncoder
impl RefUnwindSafe for ProtobufEncoder
impl Send for ProtobufEncoder
impl Sync for ProtobufEncoder
impl Unpin for ProtobufEncoder
impl UnsafeUnpin for ProtobufEncoder
impl UnwindSafe for ProtobufEncoder
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