Skip to main content

wit_bindgen_wrpc/examples/
_2_imported_resources.rs

1crate::generate!({
2    inline: r#"
3        package example:imported-resources;
4
5        world import-some-resources {
6            enum level {
7                debug,
8                info,
9                warn,
10                error,
11            }
12            resource logger {
13                constructor(max-level: level);
14
15                get-max-level: func() -> level;
16                set-max-level: func(level: level);
17
18                log: func(level: level, msg: string);
19            }
20        }
21    "#,
22
23    // provided to satisfy imports, since `wit_bindgen_wrpc` crate is not imported here.
24    // not required for external use.
25    anyhow_path: "anyhow",
26    bytes_path: "bytes",
27    futures_path: "futures",
28    tokio_util_path: "tokio_util",
29    wasm_tokio_path: "wasm_tokio",
30    wrpc_transport_path: "wrpc_transport",
31});