pub struct UniversalEngine { /* private fields */ }
Expand description
A WebAssembly Universal
Engine.
Implementations§
Source§impl UniversalEngine
impl UniversalEngine
Sourcepub fn new(
compiler: Box<dyn Compiler>,
target: Target,
features: Features,
memory_allocator: LimitedMemoryPool,
) -> Self
pub fn new( compiler: Box<dyn Compiler>, target: Target, features: Features, memory_allocator: LimitedMemoryPool, ) -> Self
Create a new UniversalEngine
with the given config
Sourcepub fn headless(memory_allocator: LimitedMemoryPool) -> Self
pub fn headless(memory_allocator: LimitedMemoryPool) -> 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
).
Sourcepub fn compile_universal(
&self,
binary: &[u8],
tunables: &dyn Tunables,
) -> Result<UniversalExecutable, CompileError>
pub fn compile_universal( &self, binary: &[u8], tunables: &dyn Tunables, ) -> Result<UniversalExecutable, CompileError>
Compile a WebAssembly binary
Sourcepub fn load_universal_executable(
&self,
executable: &UniversalExecutable,
) -> Result<UniversalArtifact, CompileError>
pub fn load_universal_executable( &self, executable: &UniversalExecutable, ) -> Result<UniversalArtifact, CompileError>
Load a UniversalExecutable
with this engine.
Sourcepub fn load_universal_executable_ref(
&self,
executable: &UniversalExecutableRef<'_>,
) -> Result<UniversalArtifact, CompileError>
pub fn load_universal_executable_ref( &self, executable: &UniversalExecutableRef<'_>, ) -> Result<UniversalArtifact, CompileError>
Load a UniversalExecutableRef
with this engine.
Sourcepub fn register_signature(
&self,
func_type: FunctionType,
) -> VMSharedSignatureIndex
pub fn register_signature( &self, func_type: FunctionType, ) -> VMSharedSignatureIndex
Register a signature
Sourcepub fn register_function_metadata(
&self,
func_data: VMCallerCheckedAnyfunc,
) -> VMFuncRef
pub fn register_function_metadata( &self, func_data: VMCallerCheckedAnyfunc, ) -> VMFuncRef
Register some function metadata
Sourcepub fn lookup_signature(
&self,
sig: VMSharedSignatureIndex,
) -> Option<FunctionType>
pub fn lookup_signature( &self, sig: VMSharedSignatureIndex, ) -> Option<FunctionType>
Lookup a signature
Trait Implementations§
Source§impl Clone for UniversalEngine
impl Clone for UniversalEngine
Source§fn clone(&self) -> UniversalEngine
fn clone(&self) -> UniversalEngine
Returns a duplicate 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 moreAuto 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