pub enum BoundaryType {
Show 17 variants
Int,
Float,
Bool,
Text,
Date,
Moment,
Word32,
Word64,
Seq(Box<BoundaryType>),
Struct(String),
Enum(String),
Result(Box<BoundaryType>, Box<BoundaryType>),
Map(Box<BoundaryType>, Box<BoundaryType>),
Tuple(Vec<BoundaryType>),
Builtin(String),
Set(Box<BoundaryType>),
Option(Box<BoundaryType>),
}Expand description
A parameter’s (or struct field’s) declared type, RESOLVED at compile time into a self-contained
form a STATICALLY-typed consumer can use without the AST or the interner. The dynamically-typed
tree-walker/VM and the scalar-only native JIT never needed static types, so they were not put in
the bytecode before; they are now a first-class part of the compiled program (a struct is
referenced by name, its layout living in CompiledProgram::struct_types).
Variants§
Int
Float
Bool
Text
Date
Moment
Word32
A Word32/Word64 wrapping-integer (ℤ/2ⁿ) — a native i32/i64 scalar, so a Seq of Word32
parameter (a crypto state array) resolves its element kind cross-region.
Word64
Seq(Box<BoundaryType>)
Seq of <elem>.
Struct(String)
A user struct, by name — its field layout is in CompiledProgram::struct_types.
Enum(String)
A user enum (sum type), by name. Carried as one i32 handle whose word 0 is the constructor
tag; Inspect/TestArm read the tag directly, so no separate layout is needed.
Result(Box<BoundaryType>, Box<BoundaryType>)
Result of <ok> and <err> — an enum with no NAME, carrying its two payload types.
★ STRUCTURAL BECAUSE IT IS ANONYMOUS. Every other enum here is a name to look up in
CompiledProgram::enum_types, because a ## An X is one of: declared it. A Result
is written at its use site and never declared, and two instantiations in one program
(Result of Int and E beside Result of Text and F) are different types that would
collide under any single name — so the payload types are carried here rather than
resolved through a table. Laid out exactly as BoundaryType::Enum: one i32 handle
whose word 0 is the Ok/Err tag.
Map(Box<BoundaryType>, Box<BoundaryType>)
Map of <key> to <value> — one i32 handle. The key kind is recovered at each access from the
key expression’s own kind (no map metadata needed); the VALUE kind is carried here so a
parameter map’s item k of m resolves its result kind cross-region.
Tuple(Vec<BoundaryType>)
A HETEROGENEOUS tuple (Pair/Triple of mixed element types) — one i32 handle to a buffer of
8-byte slots, each holding its element at its own kind. The per-position element types are
carried so a item N of t (constant N) resolves its result kind cross-region. (A homogeneous
tuple resolves to BoundaryType::Seq instead — it shares the list buffer layout.)
Builtin(String)
A first-class BUILTIN value type by name (Uuid, Duration, Time, Span, Money,
Quantity, Rational, Complex, Decimal, Modular) — a scalar/handle type whose wasm
register kind is fixed by its name, not by a user-defined layout. Carried by name (like
BoundaryType::Struct/BoundaryType::Enum) so a cross-region parameter/return of one of
these types (uuidV5(namespace: Uuid) -> Uuid) seeds the correct handle kind; a name with no
wasm kind resolves to None and is left soundly unmodeled.
Set(Box<BoundaryType>)
Set of <elem> — one i32 handle to an insertion-ordered dedup’d buffer, exactly like the VM’s
hashset. The element type distinguishes the two self-describing set kinds: a Set of Int rides
Kind::Set (i64 slots, dedup by value) and a Set of Text rides Kind::SetText (Text-handle
slots, dedup by byte equality); other element types have no self-contained set kind and resolve
to None. (Placed LAST so the pre-existing bincode variant indices stay stable.)
Option(Box<BoundaryType>)
Option of <inner> — an anonymous two-constructor enum (Some carrying one payload,
None carrying nothing), carrying its payload type.
★ STRUCTURAL FOR THE SAME REASON AS Result, and absent for a long time because an Option
used not to be a value at all: some x compiled to x and none to the Nothing
sentinel, so there was no type to carry and boundary_of_type_expr fell to _ => None.
Now that an Option is a real tagged inductive, the payload type has to reach the backends
or they cannot emit a printer for a When Some (v): arm — which is a real refusal on wasm
(“Show of an unknown-kind value”) for an Option that happens to be absent, since that arm
is still lowered even though it never runs.
(Placed LAST so the pre-existing bincode variant indices stay stable — the same rule Set
records above.)
Trait Implementations§
Source§impl Clone for BoundaryType
impl Clone for BoundaryType
Source§fn clone(&self) -> BoundaryType
fn clone(&self) -> BoundaryType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BoundaryType
impl Debug for BoundaryType
Source§impl<'de> Deserialize<'de> for BoundaryType
impl<'de> Deserialize<'de> for BoundaryType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for BoundaryType
impl PartialEq for BoundaryType
Source§impl Serialize for BoundaryType
impl Serialize for BoundaryType
impl StructuralPartialEq for BoundaryType
Auto Trait Implementations§
impl Freeze for BoundaryType
impl RefUnwindSafe for BoundaryType
impl Send for BoundaryType
impl Sync for BoundaryType
impl Unpin for BoundaryType
impl UnsafeUnpin for BoundaryType
impl UnwindSafe for BoundaryType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.