pub struct Message { /* private fields */ }Expand description
The Message frame contains information required to parse the message, a calculated CRC used to verify message integrity, and the encoded records.
Implementations§
Source§impl Message
impl Message
Sourcepub fn new(headers: Headers, records: &[u8], crc: u32) -> Self
pub fn new(headers: Headers, records: &[u8], crc: u32) -> Self
Constructs a Message instance with the provided Headers, records batch and CRC.
Sourcepub fn single(records: &[u8], version: u32) -> Self
pub fn single(records: &[u8], version: u32) -> Self
Shorthand method for constructing a Message instance with a batch size of 1.
Sourcepub fn batch(records: &[u8], batch_size: u32, version: u32) -> Self
pub fn batch(records: &[u8], batch_size: u32, version: u32) -> Self
Shorthand method for constructing a Message instance with a provided batch size.
Sourcepub fn encode(&self, buffer: &mut Vec<u8>)
pub fn encode(&self, buffer: &mut Vec<u8>)
Encodes this Message instance into the provided buffer.
Trait Implementations§
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl !Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
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