Struct wasmer_engine_native::NativeEngine [−][src]
A WebAssembly Native
Engine.
Implementations
impl NativeEngine
[src]
pub fn headless() -> Self
[src]
Create a headless NativeEngine
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
).
pub fn set_deterministic_prefixer<F>(&mut self, prefixer: F) where
F: Fn(&[u8]) -> String + Send + 'static,
[src]
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 shared 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
impl Clone for NativeEngine
[src]
fn clone(&self) -> NativeEngine
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Engine for NativeEngine
[src]
fn target(&self) -> &Target
[src]
The target
fn register_signature(&self, func_type: &FunctionType) -> VMSharedSignatureIndex
[src]
Register a signature
fn lookup_signature(&self, sig: VMSharedSignatureIndex) -> Option<FunctionType>
[src]
Lookup a signature
fn validate(&self, binary: &[u8]) -> Result<(), CompileError>
[src]
Validates a WebAssembly module
fn compile(
&self,
_binary: &[u8],
_tunables: &dyn Tunables
) -> Result<Arc<dyn Artifact>, CompileError>
[src]
&self,
_binary: &[u8],
_tunables: &dyn Tunables
) -> Result<Arc<dyn Artifact>, CompileError>
Compile a WebAssembly binary (it will fail because the compiler
flag is disabled).
unsafe fn deserialize(
&self,
bytes: &[u8]
) -> Result<Arc<dyn Artifact>, DeserializeError>
[src]
&self,
bytes: &[u8]
) -> Result<Arc<dyn Artifact>, DeserializeError>
Deserializes a WebAssembly module (binary content of a Shared Object file)
unsafe fn deserialize_from_file(
&self,
file_ref: &Path
) -> Result<Arc<dyn Artifact>, DeserializeError>
[src]
&self,
file_ref: &Path
) -> Result<Arc<dyn Artifact>, DeserializeError>
Deserializes a WebAssembly module from a path It should point to a Shared Object file generated by this engine.
fn id(&self) -> &EngineId
[src]
fn cloned(&self) -> Arc<dyn Engine + Send + Sync>
[src]
Auto Trait Implementations
impl RefUnwindSafe for NativeEngine
[src]
impl Send for NativeEngine
[src]
impl Sync for NativeEngine
[src]
impl Unpin for NativeEngine
[src]
impl UnwindSafe for NativeEngine
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,