pub struct Batch<'a, P: Payload> { /* private fields */ }Expand description
A thin batch view over a slice of messages.
Batch formation is runtime-specific; the core only provides a convenient immutable view for policies and telemetry.
Implementations§
Source§impl<'a, P: Payload> Batch<'a, P>
impl<'a, P: Payload> Batch<'a, P>
Sourcepub const fn new(messages: &'a [Message<P>]) -> Self
pub const fn new(messages: &'a [Message<P>]) -> Self
Construct a new batch view over a slice of messages.
Sourcepub fn total_payload_bytes(&self) -> usize
pub fn total_payload_bytes(&self) -> usize
Total byte size across message payloads.
Sourcepub fn first_flagged(&self) -> bool
pub fn first_flagged(&self) -> bool
Convenience: is the first message marked FIRST_IN_BATCH (if present)?
Sourcepub fn last_flagged(&self) -> bool
pub fn last_flagged(&self) -> bool
Convenience: is the last message marked LAST_IN_BATCH (if present)?
Sourcepub fn assert_flags_consistent(&self)
pub fn assert_flags_consistent(&self)
(Optional) Validate flags are consistent with batch boundaries. Enable only when you want assertions (e.g., in tests) via a feature flag.
Trait Implementations§
Source§impl<'a, P: Payload> Payload for &'a Batch<'a, P>
impl<'a, P: Payload> Payload for &'a Batch<'a, P>
Source§fn buffer_descriptor(&self) -> BufferDescriptor
fn buffer_descriptor(&self) -> BufferDescriptor
Return a descriptor containing the byte size of this payload.
Source§impl<'a, P: Payload> Payload for Batch<'a, P>
impl<'a, P: Payload> Payload for Batch<'a, P>
Source§fn buffer_descriptor(&self) -> BufferDescriptor
fn buffer_descriptor(&self) -> BufferDescriptor
Return a descriptor containing the byte size of this payload.
impl<'a, P: Copy + Payload> Copy for Batch<'a, P>
Auto Trait Implementations§
impl<'a, P> Freeze for Batch<'a, P>
impl<'a, P> RefUnwindSafe for Batch<'a, P>where
P: RefUnwindSafe,
impl<'a, P> Send for Batch<'a, P>where
P: Sync,
impl<'a, P> Sync for Batch<'a, P>where
P: Sync,
impl<'a, P> Unpin for Batch<'a, P>
impl<'a, P> UnsafeUnpin for Batch<'a, P>
impl<'a, P> UnwindSafe for Batch<'a, P>where
P: RefUnwindSafe,
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