[][src]Crate wit_text

A crate to parse the textual format for WebAssembly interface types.

This crate is a work-in-progress and should expect to have a good deal of change as the official proposal evolves. The main purpose of this crate is to parse a textual file into a binary representation, and the parsing includes parsing of all of the WebAssembly core types/syntax as well.

Structs

Export

An exported wasm interface types function

Func

A definition of an adapter function

Implement

A means of implementing a core wasm imported function with an adapter function.

Import

An imported function declaration using wasm interface types.

Instructions

A list of instructions, possibly in s-expression form

MemoryToString

Payload of the memory-to-string instruction

Module

A WebAssembly interface types-enhanced module.

StringToMemory

Payload of the string-to-memory instruction

Type

A type declaration in a wasm interface type subsection

TypeUse

An inline type definition or a use of a type defined elsewhere.

Wit

A *.wit file in its entirety.

Enums

Adapter

List of possible @interface adapters that can be listed in a module.

FuncKind

Different flavors of functions that can be defined.

Implementation

Different ways to specify an implementation

Implemented

Different ways to specify what's being implemented

Instruction

List of instructions in adapter functions.

ValType

Possible value types that can be used in function signatures and such.

Functions

parse_file

Parses a file on the filesystem as a textual representation of WebAssembly Interface Types, returning the binary representation of the module.

parse_str

Parses an in-memory string as the textual representation of WebAssembly interface types and returned the binary serialization of the module.