pub enum Value {
Unit,
Bool(bool),
Int(i64),
Float(f64),
Pid(u64),
Message(Message),
Cap(u64),
Str(Arc<str>),
Bytes(Arc<[u8]>),
}Expand description
A dynamically-tagged runtime value.
Value::Cap is an unforgeable address for Send / Ask (phase 2).
Value::Pid remains for identity inside authenticated messages
(Message.sender / msg_sender), not for ambient addressing.
Value::Str / Value::Bytes are heap payloads shared via Arc so
register moves and mailbox hops clone the handle, not the buffer.
Variants§
Unit
Bool(bool)
Int(i64)
Float(f64)
Pid(u64)
Internal / message identity (FlowId as u64). Not a Send target.
Message(Message)
Atomic Hop envelope. See Message.
Cap(u64)
Unforgeable capability (CapId as u64). Required for Send / Ask.
Str(Arc<str>)
UTF-8 text (constant pool, natives, host).
Bytes(Arc<[u8]>)
Opaque byte buffer (constant pool, natives, host).
Implementations§
Source§impl Value
impl Value
Sourcepub fn str(s: impl AsRef<str>) -> Self
pub fn str(s: impl AsRef<str>) -> Self
Build a Value::Str from anything string-like.
Sourcepub fn bytes(b: impl AsRef<[u8]>) -> Self
pub fn bytes(b: impl AsRef<[u8]>) -> Self
Build a Value::Bytes from a byte slice.
Sourcepub fn is_truthy(&self) -> bool
pub fn is_truthy(&self) -> bool
Truthiness used by Opcode::Branch: falsy are Unit, Bool(false),
Int(0), empty Value::Str, and empty Value::Bytes.