⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

IpcBatch

Struct IpcBatch 

Source
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

Source

pub fn new(target_pid: u64) -> Self

Create a new empty batch targeting a specific process.

Source

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.

Source

pub fn len(&self) -> usize

Number of messages currently in the batch.

Source

pub fn is_empty(&self) -> bool

Whether the batch is empty.

Source

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.

Source

pub fn target_pid(&self) -> u64

Get the target PID for this batch.

Auto Trait Implementations§

§

impl Freeze for IpcBatch

§

impl RefUnwindSafe for IpcBatch

§

impl Send for IpcBatch

§

impl Sync for IpcBatch

§

impl Unpin for IpcBatch

§

impl UnwindSafe for IpcBatch

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.