pub enum ExecHint {
ValidateAndCompile,
CompileWithNonDeterministicValidation,
ValidateAndExecuteOnce,
ExecuteOnceWithNonDeterministicValidation,
Untrusted,
ForceWasmi {
lazy_validation: bool,
},
ForceWasmtime,
}Expand description
Hint used by the implementation to decide which kind of virtual machine to use.
Variants§
ValidateAndCompile
The WebAssembly code will be instantiated once and run many times. If possible, compile this WebAssembly code ahead of time.
CompileWithNonDeterministicValidation
The WebAssembly code will be instantiated once and run many times.
Contrary to ExecHint::ValidateAndCompile, the WebAssembly code isn’t fully validated
ahead of time, meaning that invalid WebAssembly modules might successfully be compiled,
which is an indesirable property in some contexts.
ValidateAndExecuteOnce
The WebAssembly code is expected to be only run once.
Note: This isn’t a hard requirement but a hint.
ExecuteOnceWithNonDeterministicValidation
The WebAssembly code will be instantiated once and run many times.
Contrary to ExecHint::ValidateAndExecuteOnce, the WebAssembly code isn’t fully
validated ahead of time, meaning that invalid WebAssembly modules might successfully be
compiled, which is an indesirable property in some contexts.
Untrusted
The WebAssembly code running through this VM is untrusted.
ForceWasmi
Forces using the wasmi backend.
This variant is useful for testing purposes.
Fields
ForceWasmtime
Forces using the wasmtime backend.
This variant is useful for testing purposes.
Implementations§
Source§impl ExecHint
impl ExecHint
Sourcepub fn available_engines() -> impl Iterator<Item = ExecHint>
pub fn available_engines() -> impl Iterator<Item = ExecHint>
Returns an iterator of all the ExecHint values corresponding to execution engines.
Note: This function is most useful for testing purposes.
Sourcepub fn force_wasmtime_if_available() -> Option<ExecHint>
pub fn force_wasmtime_if_available() -> Option<ExecHint>
Returns ForceWasmtime if it is available on the current platform, and None otherwise.
Trait Implementations§
impl Copy for ExecHint
impl Eq for ExecHint
impl StructuralPartialEq for ExecHint
Auto Trait Implementations§
impl Freeze for ExecHint
impl RefUnwindSafe for ExecHint
impl Send for ExecHint
impl Sync for ExecHint
impl Unpin for ExecHint
impl UnsafeUnpin for ExecHint
impl UnwindSafe for ExecHint
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more