pub struct JITEngine { /* private fields */ }Expand description
A WebAssembly JIT Engine.
Implementations§
Source§impl JITEngine
impl JITEngine
Sourcepub fn headless() -> Self
pub fn headless() -> Self
Create a headless JITEngine
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).
Trait Implementations§
Source§impl Engine for JITEngine
impl Engine for JITEngine
Source§fn register_signature(&self, func_type: &FunctionType) -> VMSharedSignatureIndex
fn register_signature(&self, func_type: &FunctionType) -> VMSharedSignatureIndex
Register a signature
Source§fn lookup_signature(&self, sig: VMSharedSignatureIndex) -> Option<FunctionType>
fn lookup_signature(&self, sig: VMSharedSignatureIndex) -> Option<FunctionType>
Lookup a signature
Source§fn 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
Source§unsafe 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
Source§unsafe 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 Read more
Auto Trait Implementations§
impl Freeze for JITEngine
impl RefUnwindSafe for JITEngine
impl Send for JITEngine
impl Sync for JITEngine
impl Unpin for JITEngine
impl UnwindSafe for JITEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more