Skip to main content

Crate wasmedge_sys

Crate wasmedge_sys 

Source
Expand description

§Overview

The wasmedge-sys crate defines a group of low-level Rust APIs for WasmEdge, a light-weight, high-performance, and extensible WebAssembly runtime for cloud-native, edge, and decentralized applications.

For developers, it is strongly recommended that the APIs in wasmedge-sys are used to construct high-level libraries, while wasmedge-sdk is for building up business applications.

  • Notice that wasmedge-sys requires Rust v1.71 or above in the stable channel.

§Build

To use or build the wasmedge-sys crate, the WasmEdge library is required. Please refer to WasmEdge Installation and Uninstallation to install the WasmEdge library.

  • The following table provides the versioning information about each crate of WasmEdge Rust bindings.

    wasmedge-sdkWasmEdge libwasmedge-syswasmedge-typeswasmedge-macroasync-wasi
    0.17.10.17.10.21.00.6.10.6.10.2.2
    0.16.10.16.10.20.00.6.00.6.10.2.1
    0.14.0+0.14.10.19.30.6.00.6.10.2.1
    0.14.0+0.14.00.19.20.6.00.6.10.2.1
    0.13.20.13.50.17.50.4.40.6.10.1.0
    0.13.10.13.50.17.40.4.40.6.10.1.0
    0.13.00.13.50.17.30.4.40.6.10.1.0
    0.12.20.13.40.17.20.4.40.6.10.1.0
    0.12.10.13.40.17.10.4.40.6.10.1.0
    0.12.00.13.40.17.00.4.40.6.10.1.0
    0.11.20.13.30.16.20.4.30.6.10.1.0
    0.11.00.13.30.16.00.4.30.6.00.0.3
    0.10.10.13.30.15.10.4.20.5.00.0.2
    0.10.00.13.20.15.00.4.20.5.00.0.2
    0.9.00.13.10.14.00.4.20.4.00.0.1
    0.9.00.13.00.14.00.4.20.4.00.0.1
    0.8.10.12.10.13.10.4.10.3.0-
    0.8.00.12.00.13.00.4.10.3.0-
    0.7.10.11.20.12.20.3.10.3.0-
    0.7.00.11.20.120.3.10.3.0-
    0.6.00.11.20.110.3.00.2.0-
    0.5.00.11.10.100.3.00.1.0-
    0.4.00.11.00.90.2.1--
    0.3.00.10.10.80.2--
    0.1.00.10.00.70.1--

§API Reference

§See also

Modules§

asyncLinux and async
Defines async related types.
ffi
Foreign function interfaces generated from WasmEdge C-API.
frame
Defines WasmEdge CallingFrame.
instance
Defines WasmEdge instance structs, including Function, Global, Memory, Table, and etc.
plugin
Defines PluginManager and Plugin structs.
types
Defines the WebAssembly primitive types.
utils
Defines the versioning and logging functions.

Structs§

CallingFrame
Represents a calling frame on top of stack.
Compileraot
Defines WasmEdge ahead-of-time(AOT) compiler and the relevant APIs.
Config
Defines Config struct used to check/set the configuration options.
Executor
Defines an execution environment for both pure WASM and compiled WASM.
ExportType
Defines the types of the exported wasm values.
FuncType
Struct of WasmEdge FuncType.
Function
Defines a host function.
Global
Defines a WebAssembly global variable, which stores a single value of the given type and a flag indicating whether it is mutable or not.
GlobalType
Struct of WasmEdge GlobalType.
ImportModule
An ImportModule represents a host module with a name. A host module consists of one or more host function, table, memory, and global instances, which are defined outside wasm modules and fed into wasm modules as imports.
ImportType
Defines the types of the imported wasm value.
Instance
An Instance represents an instantiated module. In the instantiation process, An Instance is created from alModule. From an Instance the exported functions, tables, memories, and globals can be fetched.
Loader
Loader is used to load WASM modules from the given WASM files or buffers.
Memory
Defines a WebAssembly memory instance, which is a linear memory described by its type. Each memory instance consists of a vector of bytes and an optional maximum size, and its size is a multiple of the WebAssembly page size (64KiB of each page).
MemoryType
Struct of WasmEdge MemoryType.
Module
Defines compiled in-memory representation of an input WASM binary.
Statistics
Struct of WasmEdge Statistics.
Store
The Store is a collection of registered modules and assists wasm modules in finding the import modules they need.
Table
A WasmEdge Table defines a WebAssembly table instance described by its type. A table is an array-like structure and stores function references.
TableType
Struct of WasmEdge TableType.
Validator
Struct of WasmEdge Validator.
WasiModule
A WasiModule is a module instance for the WASI specification.
WasmValue
Defines a WebAssembly value.

Traits§

AsInstance
The object as an module instance is required to implement this trait.

Type Aliases§

FuncRef
Defines a reference to a host function.
SyncFn
WasiCtxLinux and async
Type of wasi context that is used to configure the wasi environment.