Add more complexity to example with custom record and parameters

This commit is contained in:
2025-01-09 16:34:26 +10:30
parent fca84b9240
commit 90dc149f6a
7 changed files with 29 additions and 20 deletions

View File

@@ -2,12 +2,13 @@
mod bindings;
use bindings::{hello, Guest};
use crate::bindings::RecordString;
struct Component;
impl Guest for Component {
fn greet() {
hello();
fn greet(hello_string: RecordString) {
hello(&hello_string);
}
}

View File

@@ -1,6 +1,10 @@
package my:project;
world test {
import hello: func();
export greet: func();
record record-string {
hello-string: string,
}
import hello: func(hello-string: record-string);
export greet: func(hello-string: record-string);
}