Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bytecodealliance
GitHub Repository: bytecodealliance/wasmtime
Path: blob/main/crates/test-programs/src/bin/async_round_trip_synchronous.rs
1693 views
1
mod bindings {
2
wit_bindgen::generate!({
3
path: "../misc/component-async-tests/wit",
4
world: "round-trip",
5
async: false,
6
});
7
8
use super::Component;
9
export!(Component);
10
}
11
12
use bindings::{exports::local::local::baz::Guest as Baz, local::local::baz};
13
14
struct Component;
15
16
impl Baz for Component {
17
fn foo(s: String) -> String {
18
format!(
19
"{} - exited guest",
20
baz::foo(&format!("{s} - entered guest"))
21
)
22
}
23
}
24
25
// Unused function; required since this file is built as a `bin`:
26
fn main() {}
27
28