wasmer_engine_dylib

Struct DylibArtifact

Source
pub struct DylibArtifact { /* private fields */ }
Expand description

A compiled Wasm module, ready to be instantiated.

Implementations§

Source§

impl DylibArtifact

Source

pub fn is_deserializable(bytes: &[u8]) -> bool

Check if the provided bytes look like DylibArtifact.

This means, if the bytes look like a shared object file in the target system.

Source

pub fn get_default_extension(triple: &Triple) -> &'static str

Get the default extension when serializing this artifact

Source

pub fn from_parts_crosscompiled( metadata: ModuleMetadata, dylib_path: PathBuf, ) -> Result<Self, CompileError>

Construct a DylibArtifact from component parts.

Source

pub fn from_parts( engine_inner: &mut DylibEngineInner, metadata: ModuleMetadata, dylib_path: PathBuf, lib: Library, ) -> Result<Self, CompileError>

Construct a DylibArtifact from component parts.

Source

pub fn new(_engine: &DylibEngine, _data: &[u8]) -> Result<Self, CompileError>

Compile a data buffer into a DylibArtifact, which may then be instantiated.

Source

pub unsafe fn deserialize( engine: &DylibEngine, bytes: &[u8], ) -> Result<Self, DeserializeError>

Deserialize a DylibArtifact from bytes.

§Safety

The bytes must represent a serialized WebAssembly module.

Source

pub unsafe fn deserialize_from_file( engine: &DylibEngine, path: &Path, ) -> Result<Self, DeserializeError>

Deserialize a DylibArtifact from a file path.

§Safety

The file’s content must represent a serialized WebAssembly module.

Source

pub unsafe fn deserialize_from_file_unchecked( engine: &DylibEngine, path: &Path, ) -> Result<Self, DeserializeError>

Deserialize a DylibArtifact from a file path (unchecked).

§Safety

The file’s content must represent a serialized WebAssembly module.

Source

pub fn metadata(&self) -> &ModuleMetadata

Used in test deserialize metadata is correct

Trait Implementations§

Source§

impl Artifact for DylibArtifact

Source§

fn register_frame_info(&self)

Register thie Artifact stack frame information into the global scope. Read more
Source§

fn finished_functions(&self) -> &BoxedSlice<LocalFunctionIndex, FunctionBodyPtr>

Returns the functions allocated in memory or this Artifact ready to be run.
Source§

fn finished_function_call_trampolines( &self, ) -> &BoxedSlice<SignatureIndex, VMTrampoline>

Returns the function call trampolines allocated in memory of this Artifact, ready to be run.
Source§

fn finished_dynamic_function_trampolines( &self, ) -> &BoxedSlice<FunctionIndex, FunctionBodyPtr>

Returns the dynamic function trampolines allocated in memory of this Artifact, ready to be run.
Source§

fn signatures(&self) -> &BoxedSlice<SignatureIndex, VMSharedSignatureIndex>

Returns the associated VM signatures for this Artifact.
Source§

fn func_data_registry(&self) -> &FuncDataRegistry

Get the func data registry
Source§

fn preinstantiate(&self) -> Result<(), InstantiationError>

Do preinstantiation logic that is executed before instantiating
Source§

unsafe fn instantiate( &self, tunables: &dyn Tunables, resolver: &dyn Resolver, host_state: Box<dyn Any>, ) -> Result<InstanceHandle, InstantiationError>

Crate an Instance from this Artifact. Read more
Source§

unsafe fn finish_instantiation( &self, trap_handler: &(dyn TrapHandler + 'static), handle: &InstanceHandle, ) -> Result<(), InstantiationError>

Finishes the instantiation of a just created InstanceHandle. Read more
Source§

impl ArtifactCreate for DylibArtifact

Source§

fn serialize(&self) -> Result<Vec<u8>, SerializeError>

Serialize a DylibArtifact.

Source§

fn module(&self) -> Arc<ModuleInfo>

Return a reference-counted pointer to the module
Source§

fn module_ref(&self) -> &ModuleInfo

Return a pointer to a module.
Source§

fn module_mut(&mut self) -> Option<&mut ModuleInfo>

Gets a mutable reference to the info. Read more
Source§

fn features(&self) -> &Features

Returns the features for this Artifact
Source§

fn cpu_features(&self) -> EnumSet<CpuFeature>

Returns the CPU features for this Artifact
Source§

fn data_initializers(&self) -> &[OwnedDataInitializer]

Returns data initializers to pass to InstanceHandle::initialize
Source§

fn memory_styles(&self) -> &PrimaryMap<MemoryIndex, MemoryStyle>

Returns the memory styles associated with this Artifact.
Source§

fn table_styles(&self) -> &PrimaryMap<TableIndex, TableStyle>

Returns the table plans associated with this Artifact.
Source§

fn serialize_to_file(&self, path: &Path) -> Result<(), SerializeError>

Serializes an artifact into a file path
Source§

impl Drop for DylibArtifact

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl MemoryUsage for DylibArtifact

Source§

fn size_of_val(&self, visited: &mut dyn MemoryUsageTracker) -> usize

Returns the size of the referenced value in bytes. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

Source§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The type for metadata in pointers and references to Self.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcastable for T
where T: Any + Send + Sync + 'static,

Source§

fn upcast_any_ref(&self) -> &(dyn Any + 'static)

upcast ref
Source§

fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)

upcast mut ref
Source§

fn upcast_any_box(self: Box<T>) -> Box<dyn Any>

upcast boxed dyn
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more