Skip to content

Commit 9798f56

Browse files
author
Guy Bedford
authored
readme: update for new bindgen macro (bytecodealliance#874)
1 parent 561aa17 commit 9798f56

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,6 @@ file. Example code using this then looks like:
217217
wit_bindgen::generate!({
218218
// the name of the world in the `*.wit` input file
219219
world: "host",
220-
221-
// For all exported worlds, interfaces, and resources, this specifies what
222-
// type they're corresponding to in this module. In this case the `MyHost`
223-
// struct defined below is going to define the exports of the `world`,
224-
// namely the `run` function.
225-
exports: {
226-
world: MyHost,
227-
},
228220
});
229221

230222
// Define a custom type and implement the generated `Guest` trait for it which
@@ -237,6 +229,10 @@ impl Guest for MyHost {
237229
print("Hello, world!");
238230
}
239231
}
232+
233+
// export! defines that the `MyHost` struct defined below is going to define
234+
// the exports of the `world`, namely the `run` function.
235+
export!(MyHost);
240236
```
241237

242238
By using [`cargo expand`](https://github.com/dtolnay/cargo-expand) or `cargo

0 commit comments

Comments
 (0)