Struct wasmer_near::UniversalArtifact [−][src]
pub struct UniversalArtifact { /* fields omitted */ }
Expand description
A compiled wasm module, ready to be instantiated.
Implementations
Check if the provided bytes look like a serialized UniversalArtifact
.
pub fn new(
engine: &UniversalEngine,
data: &[u8],
tunables: &dyn Tunables
) -> Result<UniversalArtifact, CompileError>
pub fn new(
engine: &UniversalEngine,
data: &[u8],
tunables: &dyn Tunables
) -> Result<UniversalArtifact, CompileError>
Compile a data buffer into a UniversalArtifact
, which may then be instantiated.
pub unsafe fn deserialize(
universal: &UniversalEngine,
bytes: &[u8]
) -> Result<UniversalArtifact, DeserializeError>
pub unsafe fn deserialize(
universal: &UniversalEngine,
bytes: &[u8]
) -> Result<UniversalArtifact, DeserializeError>
Deserialize a UniversalArtifact
Safety
This function is unsafe because rkyv reads directly without validating the data.
pub fn from_parts(
inner_engine: &mut UniversalEngineInner,
serializable: SerializableModule
) -> Result<UniversalArtifact, CompileError>
pub fn from_parts(
inner_engine: &mut UniversalEngineInner,
serializable: SerializableModule
) -> Result<UniversalArtifact, CompileError>
Construct a UniversalArtifact
from component parts.
Get the default extension when serializing this artifact
Trait Implementations
Return a reference-counted pointer to the module
Return a pointer to a module.
Gets a mutable reference to the info. Read more
Register thie Artifact
stack frame information into the global scope. Read more
Returns data initializers to pass to InstanceHandle::initialize
Returns the memory styles associated with this Artifact
.
Returns the table plans associated with this Artifact
.
Returns the functions allocated in memory or this Artifact
ready to be run. Read more
pub fn finished_function_call_trampolines(
&self
) -> &BoxedSlice<SignatureIndex, unsafe extern "C" fn(*mut VMContext, *const VMFunctionBody, *mut u128)>
pub fn finished_function_call_trampolines(
&self
) -> &BoxedSlice<SignatureIndex, unsafe extern "C" fn(*mut VMContext, *const VMFunctionBody, *mut u128)>
Returns the function call trampolines allocated in memory of this
Artifact
, ready to be run. Read more
pub fn finished_dynamic_function_trampolines(
&self
) -> &BoxedSlice<FunctionIndex, FunctionBodyPtr>
pub 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
Returns the associated VM signatures for this Artifact
.
Get the func data registry
Serializes an artifact into bytes
Serializes an artifact into a file path
Do preinstantiation logic that is executed before instantiating
unsafe 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
unsafe fn finish_instantiation(
&self,
trap_handler: &dyn TrapHandler,
handle: &InstanceHandle
) -> Result<(), InstantiationError>
unsafe fn finish_instantiation(
&self,
trap_handler: &dyn TrapHandler,
handle: &InstanceHandle
) -> Result<(), InstantiationError>
Finishes the instantiation of a just created InstanceHandle
. Read more
Returns the size of the referenced value in bytes. Read more
Auto Trait Implementations
impl RefUnwindSafe for UniversalArtifact
impl Send for UniversalArtifact
impl Sync for UniversalArtifact
impl Unpin for UniversalArtifact
impl UnwindSafe for UniversalArtifact
Blanket Implementations
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
pub fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
pub fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Mutably borrows from an owned value. Read more