Skip to main content

Module typed

Module typed 

Source
Expand description

A typed view of a procedure signature.

A procedure carries a high-level (WIT) signature; the VM stack only holds felts. TypedProcInfo joins the two: it prints the signature, turns argument text into stack felts, and result felts back into text.

The felts follow the canonical ABI: one stack slot per leaf field, so struct { u8, u8 } is two felts. This is the layout of a component export, the kind a caller reaches with call, and the only convention this module takes.

Types that take one token, like word and felt, go through a WitScalarCodec. Those two are built in; the caller adds others with TypedProcInfo::with_scalar_codec.

Structs§

FeltCodec
Codec for the WIT felt type: one decimal token, one felt.
TypedProcInfo
The typed signature of one exported procedure.
WordCodec
Codec for the WIT word type: one hex token, four felts.

Enums§

TypedError
Errors from turning argument tokens into felts, or result felts into text, for a procedure signature.

Constants§

MIDEN_CORE_TYPES
The WIT interface of the core types. The built-in codecs belong to it.

Traits§

WitScalarCodec
How to encode and print one WIT type.