pub trait Artifact: Send + Sync {
// Required methods
fn offsets(&self) -> &VMOffsets;
fn import_counts(&self) -> &ImportCounts;
fn functions(&self) -> &BoxedSlice<LocalFunctionIndex, VMLocalFunction>;
fn passive_elements(&self) -> &BTreeMap<ElemIndex, Box<[FunctionIndex]>>;
fn element_segments(&self) -> &[OwnedTableInitializer];
fn data_segments(&self) -> &[OwnedDataInitializer];
fn globals(&self) -> &[(GlobalType, GlobalInit)];
fn start_function(&self) -> Option<FunctionIndex>;
fn export_field(&self, name: &str) -> Option<ExportIndex>;
fn signatures(&self) -> &[VMSharedSignatureIndex];
fn function_signature(
&self,
index: FunctionIndex,
) -> Option<VMSharedSignatureIndex>;
}
Expand description
A predecesor of a full module Instance.
This type represents parts of a compiled WASM module (Executable
) that
are pre-allocated in within some Engine’s store.
Some other operations such as linking, relocating and similar may also be performed during constructon of the Artifact, making this type particularly well suited for caching in-memory.
Required Methods§
Sourcefn import_counts(&self) -> &ImportCounts
fn import_counts(&self) -> &ImportCounts
The count of imported entities.
Sourcefn functions(&self) -> &BoxedSlice<LocalFunctionIndex, VMLocalFunction>
fn functions(&self) -> &BoxedSlice<LocalFunctionIndex, VMLocalFunction>
The locally defined functions.
These are published and ready to call.
Sourcefn passive_elements(&self) -> &BTreeMap<ElemIndex, Box<[FunctionIndex]>>
fn passive_elements(&self) -> &BTreeMap<ElemIndex, Box<[FunctionIndex]>>
Passive table elements.
Sourcefn element_segments(&self) -> &[OwnedTableInitializer]
fn element_segments(&self) -> &[OwnedTableInitializer]
Table initializers.
Sourcefn data_segments(&self) -> &[OwnedDataInitializer]
fn data_segments(&self) -> &[OwnedDataInitializer]
Memory initializers.
TODO: consider making it an iterator of DataInitializer
s instead?
Sourcefn globals(&self) -> &[(GlobalType, GlobalInit)]
fn globals(&self) -> &[(GlobalType, GlobalInit)]
Passive table elements.
Sourcefn start_function(&self) -> Option<FunctionIndex>
fn start_function(&self) -> Option<FunctionIndex>
The function index to the start function.
Sourcefn export_field(&self, name: &str) -> Option<ExportIndex>
fn export_field(&self, name: &str) -> Option<ExportIndex>
Function by export name.
Sourcefn signatures(&self) -> &[VMSharedSignatureIndex]
fn signatures(&self) -> &[VMSharedSignatureIndex]
Mapping between module SignatureIndex and VMSharedSignatureIndex.
Sourcefn function_signature(
&self,
index: FunctionIndex,
) -> Option<VMSharedSignatureIndex>
fn function_signature( &self, index: FunctionIndex, ) -> Option<VMSharedSignatureIndex>
Obtain the function signature for either the import or local definition.