Skip to content

Commit aff63dc

Browse files
fix(lang/rust): sentence that was cut short
1 parent a1bda3f commit aff63dc

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

  • component-model/src/language-support

component-model/src/language-support/rust.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,17 @@ Your code should look something like the following:
145145

146146
There are a few points of note in the code listing above:
147147

148-
- The `AdderComponent` struct is introduced, but is only useful as an implementer of the `Guest` trait.
149-
- The `bindings::exports::docs::adder::add::Guest` trait mirrors the `docs:adder/add` interface
150-
- Our `AdderComponent` implements (in both the Rust sense and the WIT sense) the
151-
- The [`export!()` macro][export-macro] is generated by `wit_bindgen::generate!` macro, and does important setup
152-
- `export!` is easiest used from inside the `bindings` module, *but* we need to refer to the `super::AdderComponent` struct
148+
1. The `AdderComponent` struct is introduced, but is only useful as an implementer of the `Guest` trait.
149+
2. The `bindings::exports::docs::adder::add::Guest` trait mirrors the `docs:adder/add` interface that is exported.
150+
3. Given (1) and (2), `AdderComponent` implements (in the WIT sense) the `adder` world, via the generated bindings.
151+
4. The [`export!()` macro][export-macro] is generated by `wit_bindgen::generate!` macro, and does important setup.
152+
- `export!` is easiest used from inside the `bindings` module, *but* we need to refer to the `super::AdderComponent` struct
153+
154+
> [!NOTE]
155+
> To dive into the code generated by the `wit_bindgen::generate!` macro, you can use the [`cargo-expand` crate][crates-cargo-expand]
153156
154157
[export-macro]: https://docs.rs/wit-bindgen/latest/wit_bindgen/macro.generate.html#exports-the-export-macro
158+
[crates-cargo-expand]: https://crates.io/crates/cargo-expand
155159

156160
## 6. Building a Component
157161

0 commit comments

Comments
 (0)