1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
mod ctx;
mod r#impl;
mod witx;

pub use ctx::WasiNnCtx;

// Defines a `struct WasiNn` with member fields and appropriate APIs for dealing with all the
// various WASI exports.
wasmtime_wiggle::wasmtime_integration!({
    // The wiggle code to integrate with lives here:
    target: witx,
    // This must be the same witx document as used above:
    witx: ["$WASI_ROOT/phases/ephemeral/witx/wasi_ephemeral_nn.witx"],
    // This must be the same ctx type as used for the target:
    ctx: WasiNnCtx,
    // This macro will emit a struct to represent the instance, with this name and docs:
    modules: {
        wasi_ephemeral_nn => {
          name: WasiNn,
          docs: "An instantiated instance of the wasi-nn exports.",
          function_override: {}
        }
    },
});