Skip to main content

BoundaryType

Enum BoundaryType 

Source
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

Source§

fn clone(&self) -> BoundaryType

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for BoundaryType

Source§

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

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

impl<'de> Deserialize<'de> for BoundaryType

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for BoundaryType

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 Serialize for BoundaryType

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for BoundaryType

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
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

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

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
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> Same for T

Source§

type Output = T

Should always be Self
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,