Struct wit_component::metadata::BindgenMetadata
source · pub struct BindgenMetadata {
pub world: World,
pub import_encodings: IndexMap<(String, String), StringEncoding>,
pub export_encodings: IndexMap<String, StringEncoding>,
}
Expand description
Result of extracting interfaces embedded within a core wasm file.
This structure is returned by the [extract_module_interfaces
] function.
Fields
world: World
All interfaces found within a module, merged together into one World
.
import_encodings: IndexMap<(String, String), StringEncoding>
Per-function options imported into the core wasm module, currently only related to string encoding.
export_encodings: IndexMap<String, StringEncoding>
Per-function options exported from the core wasm module, currently only related to string encoding.
Implementations
sourceimpl BindgenMetadata
impl BindgenMetadata
sourcepub fn new(world: World, encoding: StringEncoding) -> BindgenMetadata
pub fn new(world: World, encoding: StringEncoding) -> BindgenMetadata
Creates a new BindgenMetadata
instance holding the given set of
interfaces which are expected to all use the encoding
specified.
sourcepub fn merge(&mut self, other: BindgenMetadata) -> Result<()>
pub fn merge(&mut self, other: BindgenMetadata) -> Result<()>
Merges another BindgenMetadata
into this one.
This operation is intended to be akin to “merging worlds” when the abstraction level for that is what we’re working at here. For now the merge operation only succeeds if the two metadata descriptions are entirely disjoint.
Note that at this time there’s no support for changing string encodings between metadata.