Expand description
A simple event-driven library for parsing WebAssembly binary files (or streams).
The parser library reports events as they happen and only stores parsing information for a brief period of time, making it very fast and memory-efficient. The event-driven model, however, has some drawbacks. If you need random access to the entire WebAssembly data-structure, this is not the right library for you. You could however, build such a data-structure using this library.
Modules§
- types
- Types relating to type information provided by validation.
Macros§
- for_
each_ operator - A helper macro to conveniently iterate over all opcodes recognized by this
crate. This can be used to work with either the
Operator
enumeration or theVisitOperator
trait if your use case uniformly handles all operators the same way.
Structs§
- Binary
Reader - A binary reader of the WebAssembly structures and types.
- Binary
Reader Error - A binary reader for WebAssembly modules.
- BrTable
- A br_table entries representation.
- Component
Export - Represents an export in a WebAssembly component.
- Component
Func Type - Represents a type of a function in a WebAssembly component.
- Component
Import - Represents an import in a WebAssembly component
- Component
Instantiation Arg - Represents an argument to instantiating a WebAssembly component.
- Component
Start Function - Represents the start function in a WebAssembly component.
- Const
Expr - Represents an initialization expression.
- Custom
Section Reader - A reader for custom sections of a WebAssembly module.
- Data
- Represents a data segment in a core WebAssembly module.
- Element
- Represents a core WebAssembly element segment.
- Export
- Represents an export in a WebAssembly module.
- Frame
- A Wasm control flow block on the control flow stack during Wasm validation.
- Func
ToValidate - Resources necessary to perform validation of a function.
- Func
Type - Represents a type of a function in a WebAssembly module.
- Func
Validator - Validation context for a WebAssembly function.
- Func
Validator Allocations - External handle to the internal allocations used during function validation.
- Function
Body - Represents a WebAssembly function body.
- Global
- Represents a core WebAssembly global.
- Global
Type - Represents a global’s type.
- Ieee32
- An IEEE binary32 immediate floating point value, represented as a u32 containing the bit pattern.
- Ieee64
- An IEEE binary64 immediate floating point value, represented as a u64 containing the bit pattern.
- Import
- Represents an import in a WebAssembly module.
- Indirect
Naming - Represents an indirect name in the names custom section.
- Instantiation
Arg - Represents an argument to instantiating a WebAssembly module.
- Locals
Iterator - An iterator over locals in a function body.
- Locals
Reader - A reader for a function body’s locals.
- MemArg
- Represents a memory immediate in a WebAssembly memory instruction.
- Memory
Type - Represents a memory’s type.
- Naming
- Represents a name for an index from the names section.
- Operators
Iterator - An iterator over a function’s operators.
- Operators
Iterator With Offsets - An iterator over a function’s operators with offsets.
- Operators
Reader - A reader for a core WebAssembly function’s operators.
- Parser
- An incremental parser of a binary WebAssembly module or component.
- Producers
Field - A field from the producers custom section.
- Producers
Field Value - Represents a field value in the producers custom section.
- Section
Limited - A generic structure for reading a section of a WebAssembly binary which has a limited number of items within it.
- Section
Limited Into Iter - A consuming iterator of a
SectionLimited
. - Section
Limited Into Iter With Offsets - An iterator over a limited section iterator.
- Subsections
- Iterator/reader over the contents of a section which is composed of subsections.
- Table
Type - Represents a table’s type.
- TagType
- A tag’s type.
- V128
- Represents a 128-bit vector value.
- Validator
- Validator for a WebAssembly binary module or component.
- Validator
Resources - The implementation of
WasmModuleResources
used byValidator
. - Variant
Case - Represents a case in a variant type.
- Wasm
Features - Flags for features that are enabled for validation.
- Wasm
Func Type Inputs - Iterator over the inputs of a Wasm function type.
- Wasm
Func Type Outputs - Iterator over the outputs of a Wasm function type.
Enums§
- Block
Type - Represents a block type.
- Canonical
Function - Represents a canonical function in a WebAssembly component.
- Canonical
Option - Represents options for component functions.
- Chunk
- A successful return payload from
Parser::parse
. - Component
Alias - Represents an alias in a WebAssembly component.
- Component
Defined Type - Represents a defined type in a WebAssembly component.
- Component
External Kind - Represents the kind of an external items of a WebAssembly component.
- Component
Func Result - Represents the result type of a component function.
- Component
Instance - Represents an instance in a WebAssembly component.
- Component
Name - Represents a name read from the names custom section.
- Component
Outer Alias Kind - Represents the kind of an outer alias in a WebAssembly component.
- Component
Type - Represents a type in a WebAssembly component.
- Component
Type Declaration - Represents part of a component type declaration in a WebAssembly component.
- Component
Type Ref - Represents a reference to a component type.
- Component
ValType - Represents a value type in a WebAssembly component.
- Core
Type - Represents a core type in a WebAssembly component.
- Data
Kind - The kind of data segment.
- Element
Items - Represents the items of an element segment.
- Element
Kind - The kind of element segment.
- Encoding
- The supported encoding formats for the parser.
- External
Kind - External types as defined here.
- Frame
Kind - The kind of a control flow
Frame
. - Instance
- Represents an instance of a WebAssembly module.
- Instance
Type Declaration - Represents an instance type declaration in a WebAssembly component.
- Instantiation
ArgKind - Represents the kind of an instantiation argument for a core instance.
- Module
Type Declaration - Represents a module type declaration in a WebAssembly component.
- Name
- Represents a name read from the names custom section.
- Operator
- Instructions as defined here.
- Outer
Alias Kind - Represents the kind of an outer core alias in a WebAssembly component.
- Payload
- Values that can be parsed from a WebAssembly module or component.
- Primitive
ValType - Represents a primitive value type.
- TagKind
- Represents a tag kind.
- Type
- Represents a type in a WebAssembly module.
- Type
Bounds - Represents the type bounds for imports and exports.
- TypeRef
- Represents a reference to a type definition in a WebAssembly module.
- ValType
- Represents the types of values in a WebAssembly module.
- Valid
Payload - Possible return values from
Validator::payload
.
Traits§
- From
Reader - A trait implemented for items that can be decoded directly from a
BinaryReader
, or that which can be parsed from the WebAssembly binary format. - Subsection
- A trait implemented for subsections of another outer section.
- Visit
Operator - Trait implemented by types that can visit all
Operator
variants. - Wasm
Func Type - Types that qualify as Wasm function types for validation purposes.
- Wasm
Module Resources - Types that qualify as Wasm validation database.
Functions§
- validate
- Test whether the given buffer contains a valid WebAssembly module or component,
analogous to
WebAssembly.validate
in the JS API.
Type Aliases§
- Code
Section Reader - A reader for the code section of a WebAssembly module.
- Component
Alias Section Reader - Section reader for the component alias section
- Component
Canonical Section Reader - A reader for the canonical section of a WebAssembly component.
- Component
Export Section Reader - A reader for the export section of a WebAssembly component.
- Component
Import Section Reader - A reader for the import section of a WebAssembly component.
- Component
Instance Section Reader - A reader for the component instance section of a WebAssembly component.
- Component
Name Section Reader - Type used to iterate and parse the contents of the
component-name
custom section in compnents, similar to thename
section of core modules. - Component
Type Section Reader - A reader for the type section of a WebAssembly component.
- Core
Type Section Reader - A reader for the core type section of a WebAssembly component.
- Data
Section Reader - A reader for the data section of a WebAssembly module.
- Element
Section Reader - A reader for the element section of a WebAssembly module.
- Export
Section Reader - A reader for the export section of a WebAssembly module.
- Function
Section Reader - A reader for the function section of a WebAssembly module.
- Global
Section Reader - A reader for the global section of a WebAssembly module.
- Import
Section Reader - A reader for the import section of a WebAssembly module.
- Indirect
Name Map - Represents a reader for indirect names from the names custom section.
- Instance
Section Reader - A reader for the core instance section of a WebAssembly component.
- Memory
Section Reader - A reader for the memory section of a WebAssembly module.
- NameMap
- Represents a name map from the names custom section.
- Name
Section Reader - A reader for the name custom section of a WebAssembly module.
- Producers
Section Reader - A reader for the producers custom section of a WebAssembly module.
- Result
- The result for
BinaryReader
operations. - Table
Section Reader - A reader for the table section of a WebAssembly module.
- TagSection
Reader - A reader for the tags section of a WebAssembly module.
- Type
Section Reader - A reader for the type section of a WebAssembly module.