pub struct IpcMessage {
pub topic: String,
pub payload: IpcPayload,
pub signature: Option<Vec<u8>>,
pub source_id: Uuid,
pub timestamp: DateTime<Utc>,
pub seq: u64,
pub principal: Option<String>,
}Expand description
A cross-boundary message sent over the event bus between WASM guests and the host.
Fields§
§topic: StringTopic pattern or exact match (e.g., astrid.cli.input).
payload: IpcPayloadStandardized payload structure.
signature: Option<Vec<u8>>Optional cryptographic signature for stateless verification across a distributed swarm.
source_id: UuidIdentifier of the sender plugin or agent.
timestamp: DateTime<Utc>Timestamp when the message was dispatched.
seq: u64Monotonic sequence number assigned by the event bus at publish time. Used by the dispatcher to guarantee in-order delivery per capsule.
principal: Option<String>The principal (user identity) this message is acting on behalf of.
String rather than PrincipalId because astrid-types must not
depend on astrid-core. Validation to PrincipalId happens at the
kernel boundary. None for system events (boot, lifecycle).
Implementations§
Source§impl IpcMessage
impl IpcMessage
Sourcepub fn new(
topic: impl Into<String>,
payload: IpcPayload,
source_id: Uuid,
) -> Self
pub fn new( topic: impl Into<String>, payload: IpcPayload, source_id: Uuid, ) -> Self
Create a new IPC message.
Sourcepub fn with_signature(self, signature: Vec<u8>) -> Self
pub fn with_signature(self, signature: Vec<u8>) -> Self
Attach a signature for swarm verification.
Sourcepub fn with_principal(self, principal: impl Into<String>) -> Self
pub fn with_principal(self, principal: impl Into<String>) -> Self
Set the acting principal for this message.
Trait Implementations§
Source§impl Clone for IpcMessage
impl Clone for IpcMessage
Source§fn clone(&self) -> IpcMessage
fn clone(&self) -> IpcMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more