wit_bindgen/examples/
_0_world_imports.rs

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

        world with-imports {
            /// 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();
            }
        }
    "#,
});