pub enum RtPayload {
Show 29 variants
Nothing,
Int(i64),
BigInt {
negative: bool,
magnitude: Vec<u8>,
},
Rational {
num_negative: bool,
num_magnitude: Vec<u8>,
den_magnitude: Vec<u8>,
},
Decimal {
negative: bool,
magnitude: Vec<u8>,
scale: u32,
},
Money {
negative: bool,
magnitude: Vec<u8>,
scale: u32,
currency: String,
},
Uuid([u8; 16]),
Complex {
re_negative: bool,
re_num: Vec<u8>,
re_den: Vec<u8>,
im_negative: bool,
im_num: Vec<u8>,
im_den: Vec<u8>,
},
Modular {
value: Vec<u8>,
modulus: Vec<u8>,
},
Quantity {
num_negative: bool,
num_magnitude: Vec<u8>,
den_magnitude: Vec<u8>,
dim_num: Vec<i32>,
dim_den: Vec<i32>,
unit_symbol: String,
},
Float(f64),
Bool(bool),
Char(char),
Text(String),
List(Vec<RtPayload>),
Tuple(Vec<RtPayload>),
Set(Vec<RtPayload>),
Map(Vec<(RtPayload, RtPayload)>),
Struct {
type_name: String,
fields: Vec<(String, RtPayload)>,
},
Inductive {
type_name: String,
constructor: String,
args: Vec<RtPayload>,
},
Duration(i64),
Date(i32),
Moment(i64),
Span {
months: i32,
days: i32,
},
Time(i64),
Word {
width: u32,
bits: u64,
},
Chan(ChanId),
TaskHandle(TaskId),
Peer(String),
}Expand description
A self-contained, Send value that can move between tasks and threads.
This deliberately excludes Rc/RefCell-backed and closure values: those
either are not Send or would alias another task’s heap. CRDT shared cells
(which are Arc-backed and shared rather than moved) get their own variant
when the scheduler grows them in a later phase.
Variants§
Nothing
The unit / absence value.
Int(i64)
BigInt
An exact integer that does not fit i64, carried as its sign + little-endian
magnitude bytes — a dependency-free, Send form of BigInt (reconstructed
with BigInt::from_le_bytes on the far side).
Rational
An exact rational: the signed numerator and the (always positive) denominator,
each as little-endian magnitude bytes — a dependency-free, Send form of
Rational (reconstructed with Rational::new on the far side). 1/3 survives
here exactly, where a JSON 0.333… would round.
Decimal
An exact base-10 fixed-point number (money): its signed coefficient as
little-endian magnitude bytes plus the base-10 scale (decimal places) — a
dependency-free, Send form of Decimal (reconstructed with
Decimal::from_le_bytes on the far side). 19.99 survives exactly, scale and all.
Money
An exact monetary amount: its Decimal amount (sign + LE magnitude + base-10 scale) plus the
ISO-4217 currency code. Reconstructed as Money { Decimal::from_le_bytes, currency::by_code }.
Uuid([u8; 16])
A 128-bit UUID — its 16 big-endian bytes verbatim. Reconstructed with Uuid::from_bytes.
Complex
An exact complex number re + im·i: each part a rational (signed numerator + a
positive denominator) as little-endian magnitude bytes. Reconstructed with
Complex::new on the far side; i·i = −1 survives exactly.
Fields
Modular
An element of ℤ/nℤ: its (non-negative) residue and modulus as little-endian magnitude
bytes. Reconstructed with Modular::new on the far side; the ring is preserved.
Quantity
A dimensioned physical quantity: its SI-base magnitude as an exact rational (signed
numerator + positive denominator, little-endian bytes), its dimension as the exponent
vector (dim_num[i]/dim_den[i] over the base axes), and the display unit’s symbol. The far
side rebuilds the magnitude with Rational, the dimension with Dimension::from_exps, and
resolves the unit by symbol (falling back to the SI/dimension display for compound units).
Fields
Float(f64)
Bool(bool)
Char(char)
Text(String)
An owned string (not an Rc<str>).
List(Vec<RtPayload>)
A fully-materialized sequence.
Tuple(Vec<RtPayload>)
A fixed heterogeneous tuple.
Set(Vec<RtPayload>)
A set, materialized as its elements.
Map(Vec<(RtPayload, RtPayload)>)
A map, materialized as key/value pairs.
Struct
A struct instance: its type name and named fields.
Inductive
An inductive (sum-type) value: its type, constructor, and arguments.
Duration(i64)
A duration, carried in its base unit.
Date(i32)
A calendar date.
Moment(i64)
A moment in time.
Span
A calendar span (months + days).
Time(i64)
A time-of-day.
Word
A fixed-width wrapping integer (Word32/Word64): its bit width (32 or 64) and the
value zero-extended to u64. Reconstructed via WordVal::from_u64 on the far side.
Chan(ChanId)
A channel handle (a Pipe) — an opaque scheduler token. Send (just an
id), so a channel can be passed as a spawn argument across worker threads;
the receiving task resolves it against the one shared scheduler.
TaskHandle(TaskId)
A spawned-task handle — likewise an opaque Send scheduler token.
Peer(String)
A remote-peer handle — its canonical relay topic. A String is trivially
Send, so a peer can be passed as a spawn argument across worker threads.