pub struct StaticlibArtifact { /* private fields */ }
Expand description
A compiled wasm module, ready to be instantiated.
Implementations
sourceimpl StaticlibArtifact
impl StaticlibArtifact
sourcepub fn is_deserializable(bytes: &[u8]) -> bool
pub fn is_deserializable(bytes: &[u8]) -> bool
Check if the provided bytes look like StaticlibArtifact
.
This means, if the bytes look like a static object file in the target system.
sourcepub fn get_default_extension(triple: &Triple) -> &'static str
pub fn get_default_extension(triple: &Triple) -> &'static str
Get the default extension when serializing this artifact
sourcepub fn from_parts_crosscompiled(
engine_inner: &mut StaticlibEngineInner,
metadata: ModuleMetadata,
module_bytes: Vec<u8>,
metadata_length: usize
) -> Result<Self, CompileError>
pub fn from_parts_crosscompiled(
engine_inner: &mut StaticlibEngineInner,
metadata: ModuleMetadata,
module_bytes: Vec<u8>,
metadata_length: usize
) -> Result<Self, CompileError>
Construct a StaticlibArtifact
from component parts.
sourcepub fn new(
_engine: &StaticlibEngine,
_data: &[u8]
) -> Result<Self, CompileError>
pub fn new(
_engine: &StaticlibEngine,
_data: &[u8]
) -> Result<Self, CompileError>
Compile a data buffer into a StaticlibArtifact
, which may then be instantiated.
sourcepub unsafe fn deserialize(
engine: &StaticlibEngine,
bytes: &[u8]
) -> Result<Self, DeserializeError>
pub unsafe fn deserialize(
engine: &StaticlibEngine,
bytes: &[u8]
) -> Result<Self, DeserializeError>
Deserialize a StaticlibArtifact
from bytes.
Safety
The bytes must represent a serialized WebAssembly module.
sourcepub fn symbol_registry(&self) -> &dyn SymbolRegistry
pub fn symbol_registry(&self) -> &dyn SymbolRegistry
Get the SymbolRegistry
used to generate the names used in the Artifact.
sourcepub fn metadata_length(&self) -> usize
pub fn metadata_length(&self) -> usize
The length in bytes of the metadata in the serialized output.
Trait Implementations
sourceimpl Artifact for StaticlibArtifact
impl Artifact for StaticlibArtifact
sourcefn register_frame_info(&self)
fn register_frame_info(&self)
Register thie Artifact
stack frame information into the global scope. Read more
sourcefn finished_functions(&self) -> &BoxedSlice<LocalFunctionIndex, FunctionBodyPtr>
fn finished_functions(&self) -> &BoxedSlice<LocalFunctionIndex, FunctionBodyPtr>
Returns the functions allocated in memory or this Artifact
ready to be run. Read more
sourcefn finished_function_call_trampolines(
&self
) -> &BoxedSlice<SignatureIndex, VMTrampoline>
fn finished_function_call_trampolines(
&self
) -> &BoxedSlice<SignatureIndex, VMTrampoline>
Returns the function call trampolines allocated in memory of this
Artifact
, ready to be run. Read more
sourcefn finished_dynamic_function_trampolines(
&self
) -> &BoxedSlice<FunctionIndex, FunctionBodyPtr>
fn finished_dynamic_function_trampolines(
&self
) -> &BoxedSlice<FunctionIndex, FunctionBodyPtr>
Returns the dynamic function trampolines allocated in memory
of this Artifact
, ready to be run. Read more
sourcefn signatures(&self) -> &BoxedSlice<SignatureIndex, VMSharedSignatureIndex>
fn signatures(&self) -> &BoxedSlice<SignatureIndex, VMSharedSignatureIndex>
Returns the associated VM signatures for this Artifact
.
sourcefn func_data_registry(&self) -> &FuncDataRegistry
fn func_data_registry(&self) -> &FuncDataRegistry
Get the func data registry
sourcefn preinstantiate(&self) -> Result<(), InstantiationError>
fn preinstantiate(&self) -> Result<(), InstantiationError>
Do preinstantiation logic that is executed before instantiating
sourceunsafe fn instantiate(
&self,
tunables: &dyn Tunables,
resolver: &dyn Resolver,
host_state: Box<dyn Any + 'static, Global>
) -> Result<InstanceHandle, InstantiationError>
unsafe fn instantiate(
&self,
tunables: &dyn Tunables,
resolver: &dyn Resolver,
host_state: Box<dyn Any + 'static, Global>
) -> Result<InstanceHandle, InstantiationError>
Crate an Instance
from this Artifact
. Read more
sourceunsafe fn finish_instantiation(
&self,
trap_handler: &(dyn TrapHandler + 'static),
handle: &InstanceHandle
) -> Result<(), InstantiationError>
unsafe fn finish_instantiation(
&self,
trap_handler: &(dyn TrapHandler + 'static),
handle: &InstanceHandle
) -> Result<(), InstantiationError>
Finishes the instantiation of a just created InstanceHandle
. Read more
sourceimpl ArtifactCreate for StaticlibArtifact
impl ArtifactCreate for StaticlibArtifact
sourcefn module(&self) -> Arc<ModuleInfo>
fn module(&self) -> Arc<ModuleInfo>
Return a reference-counted pointer to the module
sourcefn module_ref(&self) -> &ModuleInfo
fn module_ref(&self) -> &ModuleInfo
Return a pointer to a module.
sourcefn module_mut(&mut self) -> Option<&mut ModuleInfo>
fn module_mut(&mut self) -> Option<&mut ModuleInfo>
Gets a mutable reference to the info. Read more
sourcefn cpu_features(&self) -> EnumSet<CpuFeature>
fn cpu_features(&self) -> EnumSet<CpuFeature>
Returns the CPU features for this Artifact
sourcefn data_initializers(&self) -> &[OwnedDataInitializer]
fn data_initializers(&self) -> &[OwnedDataInitializer]
Returns data initializers to pass to InstanceHandle::initialize
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 serialize_to_file(&self, path: &Path) -> Result<(), SerializeError>
fn serialize_to_file(&self, path: &Path) -> Result<(), SerializeError>
Serializes an artifact into a file path
sourceimpl MemoryUsage for StaticlibArtifact
impl MemoryUsage for StaticlibArtifact
sourcefn size_of_val(&self, visited: &mut dyn MemoryUsageTracker) -> usize
fn size_of_val(&self, visited: &mut dyn MemoryUsageTracker) -> usize
Returns the size of the referenced value in bytes. Read more
Auto Trait Implementations
impl RefUnwindSafe for StaticlibArtifact
impl Send for StaticlibArtifact
impl Sync for StaticlibArtifact
impl Unpin for StaticlibArtifact
impl UnwindSafe for StaticlibArtifact
Blanket Implementations
impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for F where
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
sourceimpl<T> Upcastable for T where
T: 'static + Any + Send + Sync,
impl<T> Upcastable for T where
T: 'static + Any + Send + Sync,
sourcefn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
sourcefn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref