Trait wasmer_vm::Artifact

source ·
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§

source

fn offsets(&self) -> &VMOffsets

The information about offsets into the VM context table.

source

fn import_counts(&self) -> &ImportCounts

The count of imported entities.

source

fn functions(&self) -> &BoxedSlice<LocalFunctionIndex, VMLocalFunction>

The locally defined functions.

These are published and ready to call.

source

fn passive_elements(&self) -> &BTreeMap<ElemIndex, Box<[FunctionIndex]>>

Passive table elements.

source

fn element_segments(&self) -> &[OwnedTableInitializer]

Table initializers.

source

fn data_segments(&self) -> &[OwnedDataInitializer]

Memory initializers. TODO: consider making it an iterator of DataInitializers instead?

source

fn globals(&self) -> &[(GlobalType, GlobalInit)]

Passive table elements.

source

fn start_function(&self) -> Option<FunctionIndex>

The function index to the start function.

source

fn export_field(&self, name: &str) -> Option<ExportIndex>

Function by export name.

source

fn signatures(&self) -> &[VMSharedSignatureIndex]

Mapping between module SignatureIndex and VMSharedSignatureIndex.

source

fn function_signature( &self, index: FunctionIndex ) -> Option<VMSharedSignatureIndex>

Obtain the function signature for either the import or local definition.

Implementations§

source§

impl dyn Artifact

source

pub fn downcast_arc<T: Artifact + 'static>( self: Arc<Self> ) -> Result<Arc<T>, Arc<Self>>

Downcast a dynamic Executable object to a concrete implementation of the trait.

Implementors§