In the documentation here there are examples of imported interfaces, but not of resources in the interfaces.
Specificaly I want to mark only the resource as async. I've tried various notations to no avail.
Given this world:
package floria:plugins;
world dispatch-plugin {
import floria;
}
interface floria {
resource session {
constructor();
get-entity: func(id: string) -> result<string, string>;
}
Here are my bindings:
wasmtime::component::bindgen!({
path: "assets/wit/floria-plugins.wit",
imports: {
// "floria:plugins/floria.session": async | trappable,
default: trappable,
}
});
The commented-out line is one of my attempts. :) However, I get errors such as this:
unused `imports` rules found: ["\"floria:plugins/floria.session\": FunctionFlags(ASYNC | TRAPPABLE)"]
What is the correct notation for referring to resources in imports? Is it even possible?
Note that I truncated the WIT file here. In fact I have many more imports, which I do not want to be async.
In the documentation here there are examples of imported interfaces, but not of resources in the interfaces.
Specificaly I want to mark only the resource as
async. I've tried various notations to no avail.Given this world:
Here are my bindings:
The commented-out line is one of my attempts. :) However, I get errors such as this:
What is the correct notation for referring to resources in
imports? Is it even possible?Note that I truncated the WIT file here. In fact I have many more imports, which I do not want to be
async.