Docs.rs
  • wasmtime-environ-20.0.2
    • wasmtime-environ 20.0.2
    • Docs.rs crate page
    • Apache-2.0 WITH LLVM-exception
    • Links
    • Repository
    • crates.io
    • Source
    • Owners
    • alexcrichton
    • sunfishcode
    • github:bytecodealliance:wasmtime-publish
    • Dependencies
      • anyhow ^1.0.22 normal
      • bincode ^1.2.1 normal
      • cpp_demangle ^0.4.3 normal optional
      • cranelift-entity ^0.107.2 normal
      • gimli ^0.28.0 normal
      • indexmap ^2.0.0 normal
      • log ^0.4.8 normal
      • object ^0.33 normal
      • rustc-demangle ^0.1.16 normal optional
      • serde ^1.0.188 normal
      • serde_derive ^1.0.188 normal
      • target-lexicon ^0.12.13 normal
      • thiserror ^1.0.43 normal
      • wasm-encoder ^0.202.0 normal optional
      • wasmparser ^0.202.0 normal
      • wasmprinter ^0.202.0 normal optional
      • wasmtime-component-util =20.0.2 normal optional
      • wasmtime-types ^20.0.2 normal
      • clap ^4.3.12 dev
      • env_logger ^0.10 dev
      • wat ^1.202.0 dev
    • Versions
    • 100% of the crate is documented
  • Go to latest version
  • Platform
    • i686-pc-windows-msvc
    • i686-unknown-linux-gnu
    • x86_64-apple-darwin
    • x86_64-pc-windows-msvc
    • x86_64-unknown-linux-gnu
  • Feature flags
  • Rust
    • About docs.rs
    • Privacy policy
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation

Crate wasmtime_environ

wasmtime_environ20.0.2

  • All Items
  • Re-exports
  • Modules
  • Macros
  • Structs
  • Enums
  • Constants
  • Traits
  • Functions
  • Type Aliases

Crates

  • wasmtime_environ
?
Settings

Crate wasmtime_environ

source ·
Expand description

Standalone environment for WebAssembly using Cranelift. Provides functions to translate get_global, set_global, memory.size, memory.grow, call_indirect that hardcode in the translation the base addresses of regions of memory that will hold the globals, tables and linear memories.

Re-exports§

  • pub use object;

Modules§

  • __core
    The Rust Core Library
  • obj
    Utilities for working with object files that operate as Wasmtime’s serialization and intermediate format for compiled modules.
  • packed_option
    Compact representation of Option<T> for types with a reserved value.
  • wasmparser
    A simple event-driven library for parsing WebAssembly binary files (or streams).

Macros§

  • entity_impl
    Macro which provides the common implementation of a 32-bit entity reference.
  • foreach_builtin_function
    Helper macro to iterate over all builtin functions and their signatures.
  • wasm_unsupported
    Return an Err(WasmError::Unsupported(msg)) where msg the string built by calling format! on the arguments to this macro.

Structs§

  • BoxedSlice
    A slice mapping K -> V allocating dense entity references.
  • BuiltinFunctionIndex
    An index type for builtin functions.
  • CompiledFunctionInfo
    Secondary in-memory results of function compilation.
  • CompiledModuleInfo
    Secondary in-memory results of module compilation.
  • DataIndex
    Index type of a passive data segment inside the WebAssembly module.
  • DefinedFuncIndex
    Index type of a defined function inside the WebAssembly module.
  • DefinedGlobalIndex
    Index type of a defined global inside the WebAssembly module.
  • DefinedMemoryIndex
    Index type of a defined memory inside the WebAssembly module.
  • DefinedTableIndex
    Index type of a defined table inside the WebAssembly module.
  • ElemIndex
    Index type of a passive element segment inside the WebAssembly module.
  • EntityList
    A small list of entity references allocated from a pool.
  • EntitySet
    A set of K for densely indexed entity references.
  • FilePos
    A position within an original source file,
  • FuncIndex
    Index type of a function (imported or defined) inside the WebAssembly module.
  • FuncRefIndex
    Index into the funcref table within a VMContext for a function.
  • FunctionLoc
    Description of where a function is located in the text section of a compiled image.
  • FunctionName
    The name of a function stored in the ELF_NAME_DATA section.
  • FunctionType
    Type information about functions in a wasm module.
  • Global
    A WebAssembly global.
  • GlobalIndex
    Index type of a global variable (imported or defined) inside the WebAssembly module.
  • HostPtr
    Type representing the size of a pointer for the current compilation host
  • InstructionAddressMap
    Single source location to generated address mapping.
  • Iter
    Iterate over all keys in order.
  • IterMut
    Iterate over all keys in order.
  • Keys
    Iterate over all keys in order.
  • ListPool
    A memory pool for storing lists of T.
  • Memory
    WebAssembly linear memory.
  • MemoryIndex
    Index type of a linear memory (imported or defined) inside the WebAssembly module.
  • MemoryInitializer
    A WebAssembly linear memory initializer.
  • MemoryPlan
    A WebAssembly linear memory description along with our chosen style for implementing it.
  • Metadata
    Metadata associated with a compiled ELF artifact.
  • Module
    A translated WebAssembly module, excluding the function bodies and memory initializers.
  • ModuleInternedTypeIndex
    Index type of a deduplicated type (imported or defined) inside a WebAssembly module.
  • ModuleTypes
    All types used in a core wasm module.
  • ModuleTypesBuilder
    A builder for ModuleTypes.
  • OwnedMemoryIndex
    Index type of a defined memory inside the WebAssembly module.
  • PrimaryMap
    A primary mapping K -> V allocating dense entity references.
  • ScopeVec
    Small data structure to help extend the lifetime of a slice to a higher scope.
  • SecondaryMap
    A mapping K -> V for densely indexed entity references.
  • SparseMap
    A sparse mapping of entity references.
  • StackMap
    A map for determining where live GC references live in a stack frame.
  • StackMapInformation
    The offset within a function of a GC safepoint, and its associated stack map.
  • StaticMemoryInitializer
    Similar to the above MemoryInitializer but only used when memory initializers are statically known to be valid.
  • StaticModuleIndex
    Index into the global list of modules found within an entire component.
  • Table
    WebAssembly table.
  • TableIndex
    Index type of a table (imported or defined) inside the WebAssembly module.
  • TableInitialization
    Table initialization data for all tables in the module.
  • TablePlan
    A WebAssembly table description along with our chosen style for implementing it.
  • TableSegment
    A WebAssembly table initializer segment.
  • Tag
    WebAssembly event.
  • TagIndex
    Index type of an event inside the WebAssembly module.
  • TrapInformation
    Information about trap.
  • Tunables
    Tunable parameters for WebAssembly compilation.
  • TypeIndex
    Index type of a type (imported or defined) inside the WebAssembly module.
  • VMOffsets
    This class computes offsets to fields within VMContext and other related structs that JIT code accesses directly.
  • VMOffsetsFields
    Used to construct a VMOffsets
  • WasmFuncType
    WebAssembly function type – equivalent of wasmparser’s FuncType.
  • WasmFunctionInfo
    Information about a function, such as trap information, address map, and stack maps.
  • WasmRefType
    WebAssembly reference type – equivalent of wasmparser’s RefType
  • WasmparserTypeConverter

Enums§

  • EngineOrModuleTypeIndex
    An interned type index, either at the module or engine level.
  • EntityIndex
    An index of an entity.
  • EntityType
    A type of an item in a wasm module where an item is typically something that can be exported.
  • FlagValue
    Value of a configured setting for a Compiler
  • GlobalInit
    Globals are initialized via the const operators or by referring to another import.
  • InitMemory
    Argument to MemoryInitialization::init_memory indicating the current status of the instance.
  • Initializer
    Initialization routines for creating an instance, encompassing imports, modules, instances, aliases, etc.
  • MemoryInitialization
    The type of WebAssembly linear memory initialization to use for a module.
  • MemoryStyle
    Implementation styles for WebAssembly linear memory.
  • ModuleType
    Different types that can appear in a module.
  • ObjectKind
    Types of objects that can be created by Compiler::object
  • TableElementExpression
    Different kinds of expression that can initialize table elements.
  • TableInitialValue
    Initial value for all elements in a table.
  • TableSegmentElements
    Elements of a table segment, either a list of functions or list of arbitrary expressions.
  • TableStyle
    Implementation styles for WebAssembly tables.
  • Trap
  • VMGcKind
    The kind of an object in a GC heap.
  • WasmError
    A WebAssembly translation error.
  • WasmHeapType
    WebAssembly heap type – equivalent of wasmparser’s HeapType
  • WasmValType
    WebAssembly value type – equivalent of wasmparser::ValType.

Constants§

  • FUNCREF_INIT_BIT
    An “initialized bit” in a funcref table.
  • FUNCREF_MASK
    The mask we apply to all refs loaded from funcref tables.
  • I31_DISCRIMINANT
    Discriminant to check whether GC reference is an i31ref or not.
  • NON_NULL_NON_I31_MASK
    A mask that can be used to check for non-null and non-i31ref GC references with a single bitwise-and operation.
  • VERSION
    Version number of this crate.
  • VMCONTEXT_MAGIC
    Magic value for core Wasm VM contexts.
  • VM_ARRAY_CALL_HOST_FUNC_MAGIC
    Equivalent of VMCONTEXT_MAGIC except for array-call host functions.
  • VM_NATIVE_CALL_HOST_FUNC_MAGIC
    Equivalent of VMCONTEXT_MAGIC except for native-call host functions.
  • WASM32_MAX_PAGES
    The number of pages (for 32-bit modules) we can have before we run out of byte index space.
  • WASM64_MAX_PAGES
    The number of pages (for 64-bit modules) we can have before we run out of byte index space.
  • WASM_PAGE_SIZE
    WebAssembly page sizes are defined to be 64KiB.

Traits§

  • EntityRef
    A type wrapping a small integer index should implement EntityRef so it can be used as the key of an SecondaryMap or SparseMap.
  • PtrSize
    Trait used for the ptr representation of the field of VMOffsets
  • SparseMapValue
    Trait for extracting keys from values stored in a SparseMap.
  • TypeConvert
    Helpers used to convert a wasmparser type to a type in this crate.
  • TypeTrace
    A trait for things that can trace all type-to-type edges, aka all type indices within this thing.
  • Unsigned
    Helper trait used to add unsigned() methods to primitive signed integer types.

Functions§

  • demangle_function_name
    Demangles a single function name into a user-readable form.
  • demangle_function_name_or_index
    Demangles a function name if it’s provided, or returns a unified representation based on the function index otherwise.
  • iterate_address_map
    Iterate over the address map contained in the given address map section.
  • lookup_file_pos
    Lookup an offset within an encoded address map section, returning the original FilePos that corresponds to the offset, if found.
  • lookup_trap_code
    Decodes the provided trap information section and attempts to find the trap code corresponding to the offset specified.

Type Aliases§

  • SparseSet
    A sparse set of entity references.
  • WasmResult
    A convenient alias for a Result that uses WasmError as the error type.

Results

enum variant
wasmtime_environ::wasmparser::PrimitiveValType::String
The type is a string.
assoc const
wasmtime_environ::wasmparser::SegmentFlags::STRINGS
The segment contains only null-terminated strings, which …
macro
wasmtime_environ::__core::stringify
Stringifies its arguments.
method
wasmtime_environ::WasmError::to_string
method
wasmtime_environ::WasmValType::to_string
method
wasmtime_environ::WasmRefType::to_string
method
wasmtime_environ::EngineOrModuleTypeIndex::to_string
method
wasmtime_environ::WasmHeapType::to_string
method
wasmtime_environ::FlagValue::to_string
method
wasmtime_environ::Trap::to_string
method
wasmtime_environ::__core::alloc::LayoutError::to_string
method
wasmtime_environ::__core::alloc::AllocError::to_string
method
wasmtime_environ::__core::array::TryFromSliceError::to_string
method
wasmtime_environ::__core::ascii::Char::to_string
method
wasmtime_environ::__core::ascii::EscapeDefault::to_string
method
wasmtime_environ::__core::cell::BorrowError::to_string
method
wasmtime_environ::__core::cell::BorrowMutError::to_string
method
wasmtime_environ::__core::cell::Ref::to_string
method
wasmtime_environ::__core::cell::RefMut::to_string
method
wasmtime_environ::__core::char::ParseCharError::to_string
method
wasmtime_environ::__core::char::CharTryFromError::to_string
method
wasmtime_environ::__core::char::DecodeUtf16Error::to_string
method
wasmtime_environ::__core::char::EscapeUnicode::to_string
method
wasmtime_environ::__core::char::EscapeDefault::to_string
method
wasmtime_environ::__core::char::EscapeDebug::to_string
method
wasmtime_environ::__core::char::ToLowercase::to_string
method
wasmtime_environ::__core::char::ToUppercase::to_string
method
wasmtime_environ::__core::char::TryFromCharError::to_string
method
wasmtime_environ::__core::convert::Infallible::to_string
method
wasmtime_environ::__core::ffi::FromBytesWithNulError::to_string
method
wasmtime_environ::__core::ffi::FromBytesUntilNulError::to_string
method
wasmtime_environ::__core::fmt::FormatterFn::to_string
method
wasmtime_environ::__core::fmt::Error::to_string
method
wasmtime_environ::__core::fmt::Arguments::to_string
method
wasmtime_environ::__core::net::IpAddr::to_string
method
wasmtime_environ::__core::net::Ipv4Addr::to_string
method
wasmtime_environ::__core::net::Ipv6Addr::to_string
method
wasmtime_environ::__core::net::AddrParseError::to_string
method
wasmtime_environ::__core::net::SocketAddr::to_string
method
wasmtime_environ::__core::net::SocketAddrV4::to_string
method
wasmtime_environ::__core::net::SocketAddrV6::to_string
method
wasmtime_environ::__core::num::NonZero::to_string
method
wasmtime_environ::__core::num::ParseFloatError::to_string
method
wasmtime_environ::__core::num::TryFromIntError::to_string
method
wasmtime_environ::__core::num::ParseIntError::to_string
method
wasmtime_environ::__core::num::Saturating::to_string
method
wasmtime_environ::__core::num::Wrapping::to_string
method
wasmtime_environ::__core::panic::Location::to_string
method
wasmtime_environ::__core::panic::PanicInfo::to_string
method
wasmtime_environ::__core::pin::Pin::to_string
method
wasmtime_environ::__core::slice::GetManyMutError::to_string
method
wasmtime_environ::__core::slice::EscapeAscii::to_string
method
wasmtime_environ::__core::str::Utf8Error::to_string
method
wasmtime_environ::__core::str::ParseBoolError::to_string
method
wasmtime_environ::__core::str::EscapeDebug::to_string
method
wasmtime_environ::__core::str::EscapeDefault::to_string
method
wasmtime_environ::__core::str::EscapeUnicode::to_string
method
wasmtime_environ::__core::time::TryFromFloatSecsError::to_string
method
wasmtime_environ::wasmparser::BinaryReaderError::to_string
method
wasmtime_environ::wasmparser::PrimitiveValType::to_string
method
wasmtime_environ::wasmparser::PackedIndex::to_string
method
wasmtime_environ::wasmparser::UnpackedIndex::to_string
method
wasmtime_environ::wasmparser::SubType::to_string
method
wasmtime_environ::wasmparser::CompositeType::to_string
method
wasmtime_environ::wasmparser::StorageType::to_string
method
wasmtime_environ::wasmparser::ValType::to_string
method
wasmtime_environ::wasmparser::RefType::to_string
method
wasmtime_environ::wasmparser::names::KebabStr::to_string
method
wasmtime_environ::wasmparser::names::KebabString::to_string
method
wasmtime_environ::wasmparser::names::ComponentName::to_string
method
wasmtime_environ::__core::ffi::CStr::to_string_lossy
Converts a CStr into a Cow<str>.
method
wasmtime_environ::wasmparser::BinaryReader::read_string
Reads a WebAssembly string from the module.
method
wasmtime_environ::wasmparser::BinaryReader::skip_string
Advances the BinaryReader past a WebAssembly string. This …
struct
wasmtime_environ::wasmparser::names::KebabString
Represents an owned kebab string for validation.
method
wasmtime_environ::__core::ffi::CStr::into_c_string
Converts a Box<CStr> into a CString without copying or …
method
wasmtime_environ::wasmparser::names::KebabStr::to_kebab_string
Converts the slice to an owned string.
method
wasmtime_environ::__core::alloc::Allocator::shrink
Attempts to shrink the memory block.
method
wasmtime_environ::wasmparser::names::KebabString::new
Creates a new kebab string.
method
wasmtime_environ::wasmparser::types::SubtypeCx::open_instance_type
The building block for subtyping checks when components are
method
wasmtime_environ::WasmError::to_string
method
wasmtime_environ::WasmValType::to_string
method
wasmtime_environ::WasmRefType::to_string
method
wasmtime_environ::EngineOrModuleTypeIndex::to_string
method
wasmtime_environ::WasmHeapType::to_string
method
wasmtime_environ::FlagValue::to_string
method
wasmtime_environ::Trap::to_string
method
wasmtime_environ::__core::alloc::LayoutError::to_string
method
wasmtime_environ::__core::alloc::AllocError::to_string
method
wasmtime_environ::__core::array::TryFromSliceError::to_string
method
wasmtime_environ::__core::ascii::Char::to_string
method
wasmtime_environ::__core::ascii::EscapeDefault::to_string
method
wasmtime_environ::__core::cell::BorrowError::to_string
method
wasmtime_environ::__core::cell::BorrowMutError::to_string
method
wasmtime_environ::__core::cell::Ref::to_string
method
wasmtime_environ::__core::cell::RefMut::to_string
method
wasmtime_environ::__core::char::ParseCharError::to_string
method
wasmtime_environ::__core::char::CharTryFromError::to_string
method
wasmtime_environ::__core::char::DecodeUtf16Error::to_string
method
wasmtime_environ::__core::char::EscapeUnicode::to_string
method
wasmtime_environ::__core::char::EscapeDefault::to_string
method
wasmtime_environ::__core::char::EscapeDebug::to_string
method
wasmtime_environ::__core::char::ToLowercase::to_string
method
wasmtime_environ::__core::char::ToUppercase::to_string
method
wasmtime_environ::__core::char::TryFromCharError::to_string
method
wasmtime_environ::__core::convert::Infallible::to_string
method
wasmtime_environ::__core::ffi::FromBytesWithNulError::to_string
method
wasmtime_environ::__core::ffi::FromBytesUntilNulError::to_string
method
wasmtime_environ::__core::fmt::FormatterFn::to_string
method
wasmtime_environ::__core::fmt::Error::to_string
method
wasmtime_environ::__core::fmt::Arguments::to_string
method
wasmtime_environ::__core::net::IpAddr::to_string
method
wasmtime_environ::__core::net::Ipv4Addr::to_string
method
wasmtime_environ::__core::net::Ipv6Addr::to_string
method
wasmtime_environ::__core::net::AddrParseError::to_string
method
wasmtime_environ::__core::net::SocketAddr::to_string
method
wasmtime_environ::__core::net::SocketAddrV4::to_string
method
wasmtime_environ::__core::net::SocketAddrV6::to_string
method
wasmtime_environ::__core::num::NonZero::to_string
method
wasmtime_environ::__core::num::ParseFloatError::to_string
method
wasmtime_environ::__core::num::TryFromIntError::to_string
method
wasmtime_environ::__core::num::ParseIntError::to_string
method
wasmtime_environ::__core::num::Saturating::to_string
method
wasmtime_environ::__core::num::Wrapping::to_string
method
wasmtime_environ::__core::panic::Location::to_string
method
wasmtime_environ::__core::panic::PanicInfo::to_string
method
wasmtime_environ::__core::pin::Pin::to_string
method
wasmtime_environ::__core::slice::GetManyMutError::to_string
method
wasmtime_environ::__core::slice::EscapeAscii::to_string
method
wasmtime_environ::__core::str::Utf8Error::to_string
method
wasmtime_environ::__core::str::ParseBoolError::to_string
method
wasmtime_environ::__core::str::EscapeDebug::to_string
method
wasmtime_environ::__core::str::EscapeDefault::to_string
method
wasmtime_environ::__core::str::EscapeUnicode::to_string
method
wasmtime_environ::__core::time::TryFromFloatSecsError::to_string
method
wasmtime_environ::wasmparser::BinaryReaderError::to_string
method
wasmtime_environ::wasmparser::PrimitiveValType::to_string
method
wasmtime_environ::wasmparser::PackedIndex::to_string
method
wasmtime_environ::wasmparser::UnpackedIndex::to_string
method
wasmtime_environ::wasmparser::SubType::to_string
method
wasmtime_environ::wasmparser::CompositeType::to_string
method
wasmtime_environ::wasmparser::StorageType::to_string
method
wasmtime_environ::wasmparser::ValType::to_string
method
wasmtime_environ::wasmparser::RefType::to_string
method
wasmtime_environ::wasmparser::names::KebabStr::to_string
method
wasmtime_environ::wasmparser::names::KebabString::to_string
method
wasmtime_environ::wasmparser::names::ComponentName::to_string
method
wasmtime_environ::wasmparser::types::InstanceType::exports
Gets the exports of the instance type.