Add more complexity to example with custom record and parameters
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user