Struct wasmer_engine_staticlib::StaticlibEngine
source · [−]pub struct StaticlibEngine { /* private fields */ }
Expand description
A WebAssembly Staticlib
Engine.
Implementations
sourceimpl StaticlibEngine
impl StaticlibEngine
sourcepub fn headless() -> Self
pub fn headless() -> Self
Create a headless StaticlibEngine
A headless engine is an engine without any compiler attached. This is useful for assuring a minimal runtime for running WebAssembly modules.
For example, for running in IoT devices where compilers are very expensive, or also to optimize startup speed.
Important
Headless engines can’t compile or validate any modules,
they just take already processed Modules (via Module::serialize
).
sourcepub fn set_deterministic_prefixer<F>(&mut self, prefixer: F) where
F: Fn(&[u8]) -> String + Send + 'static,
pub fn set_deterministic_prefixer<F>(&mut self, prefixer: F) where
F: Fn(&[u8]) -> String + Send + 'static,
Sets a prefixer for the Wasm module, so we can avoid any collisions in the exported function names on the generated object.
This, allows us to rather than have functions named
wasmer_function_1
to be named wasmer_function_PREFIX_1
.
Important
This prefixer function should be deterministic, so the compilation remains deterministic.
Trait Implementations
sourceimpl Clone for StaticlibEngine
impl Clone for StaticlibEngine
sourcefn clone(&self) -> StaticlibEngine
fn clone(&self) -> StaticlibEngine
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Engine for StaticlibEngine
impl Engine for StaticlibEngine
sourcefn register_signature(&self, func_type: &FunctionType) -> VMSharedSignatureIndex
fn register_signature(&self, func_type: &FunctionType) -> VMSharedSignatureIndex
Register a signature
sourcefn lookup_signature(&self, sig: VMSharedSignatureIndex) -> Option<FunctionType>
fn lookup_signature(&self, sig: VMSharedSignatureIndex) -> Option<FunctionType>
Lookup a signature
sourcefn compile(
&self,
_binary: &[u8],
_tunables: &dyn Tunables
) -> Result<Arc<dyn Artifact>, CompileError>
fn compile(
&self,
_binary: &[u8],
_tunables: &dyn Tunables
) -> Result<Arc<dyn Artifact>, CompileError>
Compile a WebAssembly binary (it will fail because the compiler
flag is disabled).
sourceunsafe fn deserialize(
&self,
bytes: &[u8]
) -> Result<Arc<dyn Artifact>, DeserializeError>
unsafe fn deserialize(
&self,
bytes: &[u8]
) -> Result<Arc<dyn Artifact>, DeserializeError>
Deserializes a WebAssembly module (binary content of a static object file)
sourceunsafe fn deserialize_from_file(
&self,
file_ref: &Path
) -> Result<Arc<dyn Artifact>, DeserializeError>
unsafe fn deserialize_from_file(
&self,
file_ref: &Path
) -> Result<Arc<dyn Artifact>, DeserializeError>
Deserializes a WebAssembly module from a path
It should point to a static object file generated by this engine.
sourcefn register_function_metadata(
&self,
func_data: VMCallerCheckedAnyfunc
) -> VMFuncRef
fn register_function_metadata(
&self,
func_data: VMCallerCheckedAnyfunc
) -> VMFuncRef
Register a function’s data.
sourceimpl MemoryUsage for StaticlibEngine
impl MemoryUsage for StaticlibEngine
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 StaticlibEngine
impl Send for StaticlibEngine
impl Sync for StaticlibEngine
impl Unpin for StaticlibEngine
impl UnwindSafe for StaticlibEngine
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.
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.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub 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,
pub fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
pub fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more