Trait wasmer_compiler::ArtifactCreate
source · pub trait ArtifactCreate: Send + Sync + Upcastable {
// Required methods
fn create_module_info(&self) -> Arc<ModuleInfo>;
fn set_module_info_name(&mut self, name: String) -> bool;
fn module_info(&self) -> &ModuleInfo;
fn features(&self) -> &Features;
fn cpu_features(&self) -> EnumSet<CpuFeature>;
fn memory_styles(&self) -> &PrimaryMap<MemoryIndex, MemoryStyle>;
fn table_styles(&self) -> &PrimaryMap<TableIndex, TableStyle>;
fn data_initializers(&self) -> &[OwnedDataInitializer];
fn serialize(&self) -> Result<Vec<u8>, SerializeError>;
}
Expand description
An Artifact
is the product that the Engine
implementation produce and use.
The Artifact
contains the compiled data for a given
module as well as extra information needed to run the
module at runtime, such as ModuleInfo
and Features
.
Required Methods§
sourcefn create_module_info(&self) -> Arc<ModuleInfo>
fn create_module_info(&self) -> Arc<ModuleInfo>
Create a ModuleInfo
for instantiation
sourcefn set_module_info_name(&mut self, name: String) -> bool
fn set_module_info_name(&mut self, name: String) -> bool
Sets the ModuleInfo
name
sourcefn module_info(&self) -> &ModuleInfo
fn module_info(&self) -> &ModuleInfo
Returns the ModuleInfo
for instantiation
sourcefn cpu_features(&self) -> EnumSet<CpuFeature>
fn cpu_features(&self) -> EnumSet<CpuFeature>
Returns the CPU features for this Artifact
sourcefn memory_styles(&self) -> &PrimaryMap<MemoryIndex, MemoryStyle>
fn memory_styles(&self) -> &PrimaryMap<MemoryIndex, MemoryStyle>
Returns the memory styles associated with this Artifact
.
sourcefn table_styles(&self) -> &PrimaryMap<TableIndex, TableStyle>
fn table_styles(&self) -> &PrimaryMap<TableIndex, TableStyle>
Returns the table plans associated with this Artifact
.
sourcefn data_initializers(&self) -> &[OwnedDataInitializer]
fn data_initializers(&self) -> &[OwnedDataInitializer]
Returns data initializers to pass to VMInstance::initialize
Implementations§
source§impl dyn ArtifactCreate + 'static
impl dyn ArtifactCreate + 'static
sourcepub fn downcast_ref<T: 'static>(&self) -> Option<&T>
pub fn downcast_ref<T: 'static>(&self) -> Option<&T>
Try to downcast the artifact into a given type.
sourcepub fn downcast_mut<T: 'static>(&mut self) -> Option<&mut T>
pub fn downcast_mut<T: 'static>(&mut self) -> Option<&mut T>
Try to downcast the artifact into a given type mutably.