Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ To invoke the imported `add` interface from the `calculate` implementation:
// (but usable) imports (e.g. the add).
mod bindings {
use super::Component;
wit_bindgen::generate!();
wit_bindgen::generate!({
generate_all
});
export!(Component);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ To implement the calculator in Rust:
export!(Component);
}

use bindings::exports::docs::rpn::types::{GuestEngine, Operation};
use bindings::exports::docs::rpn::types::{Guest, GuestEngine, Operation};

impl GuestEngine for CalcEngine {
fn new() -> Self {
Expand Down Expand Up @@ -101,11 +101,10 @@ To implement the calculator in Rust:

struct Component;

impl bindings::Guest for Component {
impl Guest for Component {
type Engine = CalcEngine;
}

bindings::export!(Component);
```

This completes the implementation of the calculator `engine` resource. Run `cargo build --target=wasm32-wasip2` to create a component `.wasm` file.
Expand Down
Loading