Trait wasmer_compiler::ArtifactCreate
source · pub trait ArtifactCreate<'a>: Send + Sync + Upcastable {
type OwnedDataInitializer: DataInitializerLike<'a> + 'a;
type OwnedDataInitializerIterator: Iterator<Item = Self::OwnedDataInitializer>;
// Required methods
fn create_module_info(&'a self) -> Arc<ModuleInfo>;
fn set_module_info_name(&'a mut self, name: String) -> bool;
fn module_info(&'a self) -> &ModuleInfo;
fn features(&'a self) -> &Features;
fn cpu_features(&'a self) -> EnumSet<CpuFeature>;
fn memory_styles(&'a self) -> &PrimaryMap<MemoryIndex, MemoryStyle>;
fn table_styles(&'a self) -> &PrimaryMap<TableIndex, TableStyle>;
fn data_initializers(&'a self) -> Self::OwnedDataInitializerIterator;
fn serialize(&'a 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 Associated Types§
sourcetype OwnedDataInitializer: DataInitializerLike<'a> + 'a
type OwnedDataInitializer: DataInitializerLike<'a> + 'a
Type of OwnedDataInitializer
returned by the data_initializers
method
sourcetype OwnedDataInitializerIterator: Iterator<Item = Self::OwnedDataInitializer>
type OwnedDataInitializerIterator: Iterator<Item = Self::OwnedDataInitializer>
Type of iterator returned by the data_initializers
method
Required Methods§
sourcefn create_module_info(&'a self) -> Arc<ModuleInfo>
fn create_module_info(&'a self) -> Arc<ModuleInfo>
Create a ModuleInfo
for instantiation
sourcefn set_module_info_name(&'a mut self, name: String) -> bool
fn set_module_info_name(&'a mut self, name: String) -> bool
Sets the ModuleInfo
name
sourcefn module_info(&'a self) -> &ModuleInfo
fn module_info(&'a self) -> &ModuleInfo
Returns the ModuleInfo
for instantiation
sourcefn cpu_features(&'a self) -> EnumSet<CpuFeature>
fn cpu_features(&'a self) -> EnumSet<CpuFeature>
Returns the CPU features for this Artifact
sourcefn memory_styles(&'a self) -> &PrimaryMap<MemoryIndex, MemoryStyle>
fn memory_styles(&'a self) -> &PrimaryMap<MemoryIndex, MemoryStyle>
Returns the memory styles associated with this Artifact
.
sourcefn table_styles(&'a self) -> &PrimaryMap<TableIndex, TableStyle>
fn table_styles(&'a self) -> &PrimaryMap<TableIndex, TableStyle>
Returns the table plans associated with this Artifact
.
sourcefn data_initializers(&'a self) -> Self::OwnedDataInitializerIterator
fn data_initializers(&'a self) -> Self::OwnedDataInitializerIterator
Returns data initializers to pass to VMInstance::initialize
Implementations§
source§impl<'a, O, I> dyn ArtifactCreate<'a, OwnedDataInitializer = O, OwnedDataInitializerIterator = I> + 'static
impl<'a, O, I> dyn ArtifactCreate<'a, OwnedDataInitializer = O, OwnedDataInitializerIterator = I> + 'static
sourcepub fn downcast_ref<T: 'static>(&'a self) -> Option<&'a T>
pub fn downcast_ref<T: 'static>(&'a self) -> Option<&'a T>
Try to downcast the artifact into a given type.
sourcepub fn downcast_mut<T: 'static>(&'a mut self) -> Option<&'a mut T>
pub fn downcast_mut<T: 'static>(&'a mut self) -> Option<&'a mut T>
Try to downcast the artifact into a given type mutably.