Skip to main content

WasmType

Enum WasmType 

Source
pub enum WasmType {
    I32,
    Bool,
    Ratio,
    StringRef,
    Commodity,
    PairRef(PairElement),
    AnyRef,
    EntityRef(EntityKind),
    Closure(ClosureSigId),
}

Variants§

§

I32

§

Bool

Boolean: a comparison / predicate / and / or result, or a runtime #t / #f. Wasm representation is identical to I32 (0 = false, nonzero = true), so it composes with if / br_if and boxes via ref.i31 exactly like I32. It is a DISTINCT compile-time type only so the debug serializer can surface it as Nil / Bool rather than Number: an I32 is a raw count (tag-count, split-count, …) that serializes as a number, whereas a Bool is a truth value. Refused by arithmetic like every non-numeric type.

§

Ratio

§

StringRef

§

Commodity

Commodity-bearing numeric: rational amount + originating commodity uuid. Distinct from Ratio so the compiler can refuse mixing money and pure-rational arithmetic at compile time. Wasm representation: (i64 numer, i64 denom, i64 commodity_hi, i64 commodity_lo).

§

PairRef(PairElement)

Homogeneous list cell: $pair WasmGC struct with an anyref car and a nullable $pair cdr. The PairElement records the car’s type at compile time so CAR/CDR can emit the correct downcast and CONS refuses heterogeneous mixing. Retires the i32-only $cons — every runtime list shape in the compiler routes through this type.

§

AnyRef

Raw anyref car payload extracted from a PairRef(AnyRef) or produced by a host fn that returns a heterogeneous value (ADR-0025). Refused by arithmetic / numeric comparison / closure call / typed pair construction; the script must downcast via type-test natives (e.g. ok?, err-code) before consuming.

§

EntityRef(EntityKind)

Typed server-entity reference: a (ref null $<kind>) GC struct whose field layout matches the nomi_entity! declaration for the kind. Refused by arithmetic / list-CONS / numeric comparison; the only legal operations are the entity-specific accessor natives (account-id, commodity-name, etc.) registered alongside the struct type.

§

Closure(ClosureSigId)

First-class closure value: (ref null $closure_<sig>) carrying a typed funcref + nullable env ref. The ClosureSigId indexes the per-context registry that owns the wasm types and per-call-site env-struct layouts. Eligible for FUNCALL / APPLY via call_ref; refused by arithmetic / numeric comparison / pair construction.

Trait Implementations§

Source§

impl Clone for WasmType

Source§

fn clone(&self) -> WasmType

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 WasmType

Source§

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

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

impl Display for WasmType

Source§

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

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

impl Hash for WasmType

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for WasmType

Source§

fn eq(&self, other: &WasmType) -> 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 Copy for WasmType

Source§

impl Eq for WasmType

Source§

impl StructuralPartialEq for WasmType

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

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,

§

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