pub struct UniversalEngine { /* private fields */ }
Expand description
A WebAssembly Universal
Engine.
Implementations§
Source§impl UniversalEngine
impl UniversalEngine
Sourcepub fn headless() -> Self
pub fn headless() -> Self
Create a headless UniversalEngine
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 Clone for UniversalEngine
impl Clone for UniversalEngine
Source§fn clone(&self) -> UniversalEngine
fn clone(&self) -> UniversalEngine
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Engine for UniversalEngine
impl Engine for UniversalEngine
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§fn register_function_metadata(
&self,
func_data: VMCallerCheckedAnyfunc,
) -> VMFuncRef
fn register_function_metadata( &self, func_data: VMCallerCheckedAnyfunc, ) -> VMFuncRef
Register a function’s data.
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
Source§impl MemoryUsage for UniversalEngine
impl MemoryUsage for UniversalEngine
Source§fn 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 Freeze for UniversalEngine
impl RefUnwindSafe for UniversalEngine
impl Send for UniversalEngine
impl Sync for UniversalEngine
impl Unpin for UniversalEngine
impl UnwindSafe for UniversalEngine
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> Upcastable for T
impl<T> Upcastable for T
Source§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
Source§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref