pub struct IpcBatch { /* private fields */ }Expand description
IPC message batch for amortizing per-message overhead.
Collects multiple small messages destined for the same target and delivers them in a single operation. This reduces per-message overhead (capability validation, task lookup) by performing these steps once per batch instead of once per message.
Implementations§
Source§impl IpcBatch
impl IpcBatch
Sourcepub fn add_to_batch(&mut self, msg: SmallMessage) -> bool
pub fn add_to_batch(&mut self, msg: SmallMessage) -> bool
Add a message to the batch.
Returns true if the batch is now full and should be flushed.
Returns false if there is still room for more messages.
Sourcepub fn flush(&mut self) -> usize
pub fn flush(&mut self) -> usize
Flush all buffered messages by sending them via fast_send.
Each message is sent individually via the fast path. Capability validation is only performed once per batch (the first message’s capability is cached for subsequent sends).
Returns the number of messages successfully sent.
Sourcepub fn target_pid(&self) -> u64
pub fn target_pid(&self) -> u64
Get the target PID for this batch.