pub struct EventFrame;Expand description
Event frame format for packing multiple events in a single packet.
Format: [len: u32][data: [u8; len]]...
Events are concatenated with 4-byte length prefixes. No additional framing.
Implementations§
Source§impl EventFrame
impl EventFrame
Sourcepub fn write_events(events: &[Bytes], buf: &mut BytesMut) -> usize
pub fn write_events(events: &[Bytes], buf: &mut BytesMut) -> usize
Write events to a buffer, returning the total bytes written.
Panics if any event exceeds u32::MAX bytes. Under normal
production paths every event is well below MAX_PAYLOAD_SIZE
(~8 KiB), but without the assertion an event larger than 4 GiB
would silently truncate the length prefix and corrupt the
framed stream — a panic is far preferable to silent data
corruption on a framing boundary.
Sourcepub fn calculate_size(events: &[Bytes]) -> usize
pub fn calculate_size(events: &[Bytes]) -> usize
Calculate total size for events
Auto Trait Implementations§
impl Freeze for EventFrame
impl RefUnwindSafe for EventFrame
impl Send for EventFrame
impl Sync for EventFrame
impl Unpin for EventFrame
impl UnsafeUnpin for EventFrame
impl UnwindSafe for EventFrame
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