Struct wasmer::UniversalEngine
source · [−]pub struct UniversalEngine { /* private fields */ }
Expand description
A WebAssembly Universal
Engine.
Implementations
sourceimpl UniversalEngine
impl UniversalEngine
sourcepub fn new(
compiler: Box<dyn Compiler + 'static, Global>,
target: Target,
features: Features
) -> UniversalEngine
pub fn new(
compiler: Box<dyn Compiler + 'static, Global>,
target: Target,
features: Features
) -> UniversalEngine
Create a new UniversalEngine
with the given config
sourcepub fn headless() -> UniversalEngine
pub fn headless() -> UniversalEngine
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
sourceimpl Clone for UniversalEngine
impl Clone for UniversalEngine
sourcepub fn clone(&self) -> UniversalEngine
pub fn clone(&self) -> UniversalEngine
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 UniversalEngine
impl Engine for UniversalEngine
sourcepub fn register_signature(
&self,
func_type: &FunctionType
) -> VMSharedSignatureIndex
pub fn register_signature(
&self,
func_type: &FunctionType
) -> VMSharedSignatureIndex
Register a signature
sourcepub fn lookup_signature(
&self,
sig: VMSharedSignatureIndex
) -> Option<FunctionType>
pub fn lookup_signature(
&self,
sig: VMSharedSignatureIndex
) -> Option<FunctionType>
Lookup a signature
sourcepub fn validate(&self, binary: &[u8]) -> Result<(), CompileError>
pub fn validate(&self, binary: &[u8]) -> Result<(), CompileError>
Validates a WebAssembly module
sourcepub fn compile(
&self,
binary: &[u8],
tunables: &dyn Tunables
) -> Result<Arc<dyn Artifact + 'static>, CompileError>
pub fn compile(
&self,
binary: &[u8],
tunables: &dyn Tunables
) -> Result<Arc<dyn Artifact + 'static>, CompileError>
Compile a WebAssembly binary
sourcepub unsafe fn deserialize(
&self,
bytes: &[u8]
) -> Result<Arc<dyn Artifact + 'static>, DeserializeError>
pub unsafe fn deserialize(
&self,
bytes: &[u8]
) -> Result<Arc<dyn Artifact + 'static>, DeserializeError>
Deserializes a WebAssembly module
sourcepub fn register_function_metadata(
&self,
func_data: VMCallerCheckedAnyfunc
) -> VMFuncRef
pub fn register_function_metadata(
&self,
func_data: VMCallerCheckedAnyfunc
) -> VMFuncRef
Register a function’s data.
sourceunsafe fn deserialize_from_file(
&self,
file_ref: &Path
) -> Result<Arc<dyn Artifact + 'static>, DeserializeError>
unsafe fn deserialize_from_file(
&self,
file_ref: &Path
) -> Result<Arc<dyn Artifact + 'static>, DeserializeError>
Deserializes a WebAssembly module from a path Read more
sourceimpl MemoryUsage for UniversalEngine
impl MemoryUsage for UniversalEngine
sourcepub fn size_of_val(&self, visited: &mut dyn MemoryUsageTracker) -> usize
pub 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 UniversalEngine
impl Send for UniversalEngine
impl Sync for UniversalEngine
impl Unpin for UniversalEngine
impl UnwindSafe for UniversalEngine
Blanket Implementations
sourceimpl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
sourcepub 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
sourceimpl<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,
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Pointable for T
impl<T> Pointable for T
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
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more