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. Defaults to now on
deserialization so capsules forwarding bus messages over the wire
(e.g. the CLI proxy) don’t need to fabricate a timestamp the SDK
doesn’t expose to them. Only filled in by the clock feature
path (kernel-side); when the feature is off (capsule SDK
consumption on wasm32-unknown-unknown), missing timestamps
fall back to the Unix epoch — capsules read timestamps from
kernel-published messages, they never construct fresh ones.
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 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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IpcMessage
impl Debug for IpcMessage
Source§impl<'de> Deserialize<'de> for IpcMessage
impl<'de> Deserialize<'de> for IpcMessage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for IpcMessage
impl PartialEq for IpcMessage
Source§fn eq(&self, other: &IpcMessage) -> bool
fn eq(&self, other: &IpcMessage) -> bool
self and other values to be equal, and is used by ==.