pub struct MessageRecord { /* private fields */ }Expand description
This struct contains a serialized CloudEvent message in the Kafka shape.
Implements StructuredSerializer & BinarySerializer traits.
To instantiate a new MessageRecord from an Event,
look at Self::from_event or use StructuredDeserializer::deserialize_structured
or BinaryDeserializer::deserialize_binary.
Implementations§
Source§impl MessageRecord
impl MessageRecord
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new empty MessageRecord
Sourcepub fn from_event(event: Event) -> Result<Self>
pub fn from_event(event: Event) -> Result<Self>
Create a new MessageRecord, filled with event serialized in binary mode.
Trait Implementations§
Source§impl BinarySerializer<MessageRecord> for MessageRecord
impl BinarySerializer<MessageRecord> for MessageRecord
fn set_spec_version(self, spec_version: SpecVersion) -> Result<Self>
fn set_attribute(self, name: &str, value: MessageAttributeValue) -> Result<Self>
fn set_extension(self, name: &str, value: MessageAttributeValue) -> Result<Self>
fn end_with_data(self, bytes: Vec<u8>) -> Result<MessageRecord>
fn end(self) -> Result<MessageRecord>
Source§impl Default for MessageRecord
impl Default for MessageRecord
Source§impl StructuredSerializer<MessageRecord> for MessageRecord
impl StructuredSerializer<MessageRecord> for MessageRecord
fn set_structured_event(self, bytes: Vec<u8>) -> Result<MessageRecord>
Auto Trait Implementations§
impl Freeze for MessageRecord
impl RefUnwindSafe for MessageRecord
impl Send for MessageRecord
impl Sync for MessageRecord
impl Unpin for MessageRecord
impl UnwindSafe for MessageRecord
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