[][src]Trait wasmer_engine::Tunables

pub trait Tunables {
    pub fn memory_style(&self, memory: &MemoryType) -> MemoryStyle;
pub fn table_style(&self, table: &TableType) -> TableStyle;
pub fn create_host_memory(
        &self,
        ty: &MemoryType,
        style: &MemoryStyle
    ) -> Result<Arc<dyn Memory>, MemoryError>;
pub unsafe fn create_vm_memory(
        &self,
        ty: &MemoryType,
        style: &MemoryStyle,
        vm_definition_location: NonNull<VMMemoryDefinition>
    ) -> Result<Arc<dyn Memory>, MemoryError>;
pub fn create_host_table(
        &self,
        ty: &TableType,
        style: &TableStyle
    ) -> Result<Arc<dyn Table>, String>;
pub unsafe fn create_vm_table(
        &self,
        ty: &TableType,
        style: &TableStyle,
        vm_definition_location: NonNull<VMTableDefinition>
    ) -> Result<Arc<dyn Table>, String>; pub fn create_global(&self, ty: GlobalType) -> Result<Arc<Global>, String> { ... }
pub unsafe fn create_memories(
        &self,
        module: &ModuleInfo,
        memory_styles: &PrimaryMap<MemoryIndex, MemoryStyle>,
        memory_definition_locations: &[NonNull<VMMemoryDefinition>]
    ) -> Result<PrimaryMap<LocalMemoryIndex, Arc<dyn Memory>>, LinkError> { ... }
pub unsafe fn create_tables(
        &self,
        module: &ModuleInfo,
        table_styles: &PrimaryMap<TableIndex, TableStyle>,
        table_definition_locations: &[NonNull<VMTableDefinition>]
    ) -> Result<PrimaryMap<LocalTableIndex, Arc<dyn Table>>, LinkError> { ... }
pub fn create_globals(
        &self,
        module: &ModuleInfo
    ) -> Result<PrimaryMap<LocalGlobalIndex, Arc<Global>>, LinkError> { ... } }

An engine delegates the creation of memories, tables, and globals to a foreign implementor of this trait.

Required methods

pub fn memory_style(&self, memory: &MemoryType) -> MemoryStyle[src]

Construct a MemoryStyle for the provided MemoryType

pub fn table_style(&self, table: &TableType) -> TableStyle[src]

Construct a TableStyle for the provided TableType

pub fn create_host_memory(
    &self,
    ty: &MemoryType,
    style: &MemoryStyle
) -> Result<Arc<dyn Memory>, MemoryError>
[src]

Create a memory owned by the host given a MemoryType and a MemoryStyle.

pub unsafe fn create_vm_memory(
    &self,
    ty: &MemoryType,
    style: &MemoryStyle,
    vm_definition_location: NonNull<VMMemoryDefinition>
) -> Result<Arc<dyn Memory>, MemoryError>
[src]

Create a memory owned by the VM given a MemoryType and a MemoryStyle.

Safety

  • vm_definition_location must point to a valid location in VM memory.

pub fn create_host_table(
    &self,
    ty: &TableType,
    style: &TableStyle
) -> Result<Arc<dyn Table>, String>
[src]

Create a table owned by the host given a TableType and a TableStyle.

pub unsafe fn create_vm_table(
    &self,
    ty: &TableType,
    style: &TableStyle,
    vm_definition_location: NonNull<VMTableDefinition>
) -> Result<Arc<dyn Table>, String>
[src]

Create a table owned by the VM given a TableType and a TableStyle.

Safety

  • vm_definition_location must point to a valid location in VM memory.
Loading content...

Provided methods

pub fn create_global(&self, ty: GlobalType) -> Result<Arc<Global>, String>[src]

Create a global with an unset value.

pub unsafe fn create_memories(
    &self,
    module: &ModuleInfo,
    memory_styles: &PrimaryMap<MemoryIndex, MemoryStyle>,
    memory_definition_locations: &[NonNull<VMMemoryDefinition>]
) -> Result<PrimaryMap<LocalMemoryIndex, Arc<dyn Memory>>, LinkError>
[src]

Allocate memory for just the memories of the current module.

pub unsafe fn create_tables(
    &self,
    module: &ModuleInfo,
    table_styles: &PrimaryMap<TableIndex, TableStyle>,
    table_definition_locations: &[NonNull<VMTableDefinition>]
) -> Result<PrimaryMap<LocalTableIndex, Arc<dyn Table>>, LinkError>
[src]

Allocate memory for just the tables of the current module.

pub fn create_globals(
    &self,
    module: &ModuleInfo
) -> Result<PrimaryMap<LocalGlobalIndex, Arc<Global>>, LinkError>
[src]

Allocate memory for just the globals of the current module, with initializers applied.

Loading content...

Implementors

Loading content...