pub struct Message {
pub sender: u64,
pub reply_cap: CapId,
pub request_id: u64,
pub tag: u16,
pub payload: Arc<Value>,
}Expand description
Envelope carried in mailboxes and registers (Atomic Hop).
payload is a Value behind Arc so hops can carry Int, Str,
Bytes, or nested messages. Mailbox byte budgets charge
Value::memory_size of the whole hop, including the payload tree.
§Security
sender: FlowId stamped by the scheduler on bytecodeSend/Ask(invariant S1). Not a capability.reply_cap:CapIdminted at the hop boundary with SEND-only rights, holder = recipient.CapId::NONEmeans “no reply grant”.
See docs/security.md.
Fields§
§sender: u64Authenticated origin FlowId (0 = trusted host / non-flow).
reply_cap: CapIdCapability granting SEND back to Self::sender, or CapId::NONE.
request_id: u64Client correlation token; echoed on replies (Ask / S2).
tag: u16Protocol discriminator (opaque to the VM).
payload: Arc<Value>Application body (shared so hop clones are cheap).
Implementations§
Source§impl Message
impl Message
Sourcepub fn new(
sender: u64,
request_id: u64,
tag: u16,
payload: impl Into<Value>,
) -> Self
pub fn new( sender: u64, request_id: u64, tag: u16, payload: impl Into<Value>, ) -> Self
Build an envelope. sender / reply_cap are placeholders until a
bytecode hop is authenticated by the scheduler.
Sourcepub fn request(request_id: u64, tag: u16, payload: impl Into<Value>) -> Self
pub fn request(request_id: u64, tag: u16, payload: impl Into<Value>) -> Self
Outgoing hop from host Rust (sender / reply_cap filled on delivery).
Sourcepub fn reply_to(req: &Self, tag: u16, payload: impl Into<Value>) -> Self
pub fn reply_to(req: &Self, tag: u16, payload: impl Into<Value>) -> Self
Reply envelope echoing request_id from a received hop (host path).
Sourcepub fn down(monitor: u64, target_flow: u64, reason: u64) -> Self
pub fn down(monitor: u64, target_flow: u64, reason: u64) -> Self
Runtime lifecycle hop: monitor DOWN (tag == TAG_SYS_DOWN).
Sourcepub fn linked_exit(target_flow: u64, reason: u64) -> Self
pub fn linked_exit(target_flow: u64, reason: u64) -> Self
Runtime lifecycle hop: Ask target exited (tag == TAG_SYS_EXIT).