Skip to main content

RtPayload

Enum RtPayload 

Source
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).

Fields

§negative: bool
§magnitude: Vec<u8>
§

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.

Fields

§num_negative: bool
§num_magnitude: Vec<u8>
§den_magnitude: Vec<u8>
§

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.

Fields

§negative: bool
§magnitude: Vec<u8>
§scale: u32
§

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 }.

Fields

§negative: bool
§magnitude: Vec<u8>
§scale: u32
§currency: String
§

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

§re_negative: bool
§re_num: Vec<u8>
§re_den: Vec<u8>
§im_negative: bool
§im_num: Vec<u8>
§im_den: Vec<u8>
§

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.

Fields

§value: Vec<u8>
§modulus: Vec<u8>
§

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

§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)

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.

Fields

§type_name: String
§fields: Vec<(String, RtPayload)>
§

Inductive

An inductive (sum-type) value: its type, constructor, and arguments.

Fields

§type_name: String
§constructor: String
§

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).

Fields

§months: i32
§days: i32
§

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.

Fields

§width: u32
§bits: u64
§

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.

Trait Implementations§

Source§

impl Clone for RtPayload

Source§

fn clone(&self) -> RtPayload

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RtPayload

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for RtPayload

Source§

fn eq(&self, other: &RtPayload) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for RtPayload

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.