Skip to main content

Module engine

Module engine 

Source
Expand description

WebAssembly component engine for executing workloads.

This module provides the core engine functionality for compiling and executing WebAssembly components. The Engine is responsible for:

  • Compiling WebAssembly components using wasmtime
  • Initializing workloads with their components and dependencies
  • Managing volume mounts and resource configurations
  • Setting up WASI and HTTP interfaces for components

§Key Types

§Example

use wash_runtime::engine::Engine;
use wash_runtime::types::Workload;

let engine = Engine::builder().build()?;
let workload = Workload {
    namespace: "default".to_string(),
    name: "my-workload".to_string(),
    // ... other fields
};

let unresolved = engine.initialize_workload("workload-1", workload)?;
// ... bind to plugins and resolve

Modules§

ctx
Component execution context for wasmtime stores.
workload
This module is primarily concerned with converting an UnresolvedWorkload into a ResolvedWorkload by resolving all components and their dependencies.

Structs§

Engine
The core WebAssembly engine for executing components and workloads.
EngineBuilder
Builder for constructing an Engine with custom configuration.