#[repr(C, align(64))]pub struct IpcMessage {
pub sender: u64,
pub msg_type: u32,
pub flags: u32,
pub payload: [u8; 240],
}Expand description
Fixed-size IPC message (256 bytes, 64-byte aligned).
Used by IPC ports, channels, and the transport layer. The header occupies 16 bytes; the payload is 240 bytes.
Fields§
§sender: u64PID/TID of the sending process.
msg_type: u32Message type identifier (protocol-specific).
flags: u32Message flags (protocol-specific).
payload: [u8; 240]Payload data (up to 240 bytes).
Implementations§
Source§impl IpcMessage
impl IpcMessage
Sourcepub const WIRE_SIZE: usize = IPC_MESSAGE_SIZE
pub const WIRE_SIZE: usize = IPC_MESSAGE_SIZE
Total wire size of the message (including header).
Sourcepub const PAYLOAD_CAPACITY: usize = IPC_PAYLOAD_CAPACITY
pub const PAYLOAD_CAPACITY: usize = IPC_PAYLOAD_CAPACITY
Maximum payload bytes.
Sourcepub const REPLY_MSG_TYPE: u32 = 0x80
pub const REPLY_MSG_TYPE: u32 = 0x80
Message type used by scheme servers for every reply (success or errno-style status).
Sourcepub const OPEN_INLINE_CAPACITY: usize
pub const OPEN_INLINE_CAPACITY: usize
Usable payload capacity for OPEN inline path (240 - 6 bytes overhead).
Sourcepub const UNLINK_INLINE_CAPACITY: usize
pub const UNLINK_INLINE_CAPACITY: usize
Usable payload capacity for UNLINK inline path (240 - 2 bytes overhead).
Sourcepub const READ_INLINE_CAPACITY: usize
pub const READ_INLINE_CAPACITY: usize
Usable payload capacity for READ inline path (240 - 8 bytes overhead).
Sourcepub const WRITE_INLINE_CAPACITY: usize
pub const WRITE_INLINE_CAPACITY: usize
Usable payload capacity for WRITE inline path (240 - 18 bytes overhead).
Sourcepub fn error_reply(sender: u64, status: i32) -> Self
pub fn error_reply(sender: u64, status: i32) -> Self
Build a standard error reply carrying a status code in payload.
The msg_type is set to 0x80 (error reply marker).
The payload contains the error code as a little-endian i32.
Sourcepub fn status_reply(sender: u64, status: u32) -> Self
pub fn status_reply(sender: u64, status: u32) -> Self
Build a reply with msg_type = 0x80 and a u32 errno-style status
(0 = success) in payload[0..4].
Single source of truth for scheme servers, replacing per-server
ok_reply/err_reply duplicates.
Trait Implementations§
Source§impl Clone for IpcMessage
impl Clone for IpcMessage
Source§fn clone(&self) -> IpcMessage
fn clone(&self) -> IpcMessage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more