pub struct Message<T> {
pub wire_version: u8,
pub msg_id: Uuid,
pub correlation_id: Option<Uuid>,
pub sender: DaemonId,
pub timestamp: Timestamp,
pub payload: T,
pub security_level: SecurityLevel,
pub verified_sender_name: Option<String>,
pub origin_installation: Option<InstallationId>,
pub agent_id: Option<AgentId>,
pub trust_snapshot: Option<TrustVector>,
}Expand description
The IPC bus message envelope wrapping any payload type.
Debug is manually implemented to delegate to T’s Debug impl.
When T = EventKind, the payload’s custom Debug redacts secret fields.
Fields§
§wire_version: u8Wire format version. Always serialized first. Receivers should check this before interpreting remaining fields.
msg_id: UuidUnique message identifier (UUID v7 for time-ordering).
correlation_id: Option<Uuid>Correlation ID for request-response patterns.
sender: DaemonIdSender daemon identity.
timestamp: TimestampDual-clock timestamp.
payload: TThe event or request payload.
security_level: SecurityLevelAccess control level for this message.
verified_sender_name: Option<String>Server-stamped verified sender name from Noise IK registry lookup.
Set by route_frame() in the bus server — never trust client-supplied values.
None for unregistered clients (CLI, Open clearance).
Note: no skip_serializing_if — postcard uses positional encoding, so the
field must always be present in the wire format for decode compatibility.
origin_installation: Option<InstallationId>Installation identity of the sender.
No skip_serializing_if — postcard positional encoding requires all fields present.
agent_id: Option<AgentId>Agent identity of the sender.
trust_snapshot: Option<TrustVector>Trust snapshot at time of message creation.
Implementations§
Source§impl<T: Serialize> Message<T>
impl<T: Serialize> Message<T>
Sourcepub fn new(
ctx: &MessageContext,
payload: T,
security_level: SecurityLevel,
epoch: Instant,
) -> Self
pub fn new( ctx: &MessageContext, payload: T, security_level: SecurityLevel, epoch: Instant, ) -> Self
Create a new message with a fresh UUID v7 and current timestamp.
Sourcepub fn with_correlation(self, id: Uuid) -> Self
pub fn with_correlation(self, id: Uuid) -> Self
Set a correlation ID for request-response linking.