Closed
Description
If I have a common.wit
:
record entity-id {
namespace: u8,
id: u64,
gen: s32,
}
record vec3 {
x: float32,
y: float32,
z: float32,
}
and an entity.wit
:
use { entity-id, vec3 } from common
entity-spawn: func(object-ref: string, position: vec3) -> option<entity-id>
What is the correct way to consume these? The naive approach of
wit_bindgen_rust::import!("src/common.wit");
wit_bindgen_rust::import!("src/entity.wit");
results in entity::EntityId
being a different type to common::EntityId
. Looking around, I think I have to do something with Opts
, but I'm not sure how to drive that.
With that being said, I've had a look around the repository, and found these issues:
- Finalizing how wit-bindgen will be used #214
- wasmtime: Allow Import of External Definitions #191
- [Question]
use
semantics with re-exports #133
which suggest that the use
system is still very much a work in progress. Based on that, I've just rolled all of my definitions into a single wit
and am modularising them manually within the guest. Should I continue doing that for the meantime?
Metadata
Metadata
Assignees
Labels
No labels