pub enum Expression<'a> {
Show 15 variants
Null,
Int(i64),
Float(f64),
String(Cow<'a, str>),
Bool(bool),
Object(BTreeMap<Cow<'a, str>, Expression<'a>>),
Array(Box<[Expression<'a>]>),
Error(Box<Error<'a>>),
Date(f64),
Bytes(Cow<'a, str>),
BigInt(Cow<'a, str>),
Undefined,
Import {
id: Id,
operation: Option<ImportOperation<'a>>,
resolution: Resolution,
},
Remap(Box<Remap<'a>>),
Export {
id: Id,
resolution: Resolution,
},
}Expand description
The main expression type, representing values and references
Variants§
Null
JSON null
Int(i64)
A 64-bit signed integer
Float(f64)
A 64-bit floating point number
String(Cow<'a, str>)
A UTF-8 string
Bool(bool)
A boolean
Object(BTreeMap<Cow<'a, str>, Expression<'a>>)
A JSON object, with Expression values
Array(Box<[Expression<'a>]>)
A JSON array, with Expression values
Error(Box<Error<'a>>)
A Javascript Error value
Date(f64)
A JavaScript Date value, represented as a number of milliseconds since the Unix epoch
Bytes(Cow<'a, str>)
A byte array, encoded as a base64 string
BigInt(Cow<'a, str>)
A BigInt value, encoded as a string
Undefined
The JavaScript undefined value
Import
Reference an imported value, possibly performing actions on it
Fields
operation: Option<ImportOperation<'a>>An optional operation to perform on the import
resolution: ResolutionThe type of resolution (promise or stub)
Remap(Box<Remap<'a>>)
A map() operation on an import
Export
The sender is exporting a new stub (or re-exporting a stub that was exported before)
The expression evaluates to a stub or promise
If this resolves to a promise, the id should always be a newly allocated ID, and The sender will proactively send a “resolve” (or “reject”) message for this ID when the promise resolves (unless it is released first). The recipient does not need to “pull” the promise explicitly; it is assumed that the recipient always wants the resolution.