wasmtime/runtime/component/bindgen_examples/
_1_world_imports.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
bindgen!({
    inline: r#"
        package example:imports;

        world my-world {
            /// Fetch a greeting to present.
            import greet: func() -> string;

            /// Log a message to the host.
            import log: func(msg: string);

            import my-custom-host: interface {
                tick: func();
            }
        }
    "#,
});