pub struct Engine { /* private fields */ }Expand description
The Engine is the entrypoint type for the runtime. It defines the kind of steps the runtime must take to execute
the WebAssembly module (compile, interpret..) and the place of execution (in-browser, host,
..).
Implementations§
Source§impl Engine
impl Engine
Sourcepub fn deterministic_id(&self) -> String
pub fn deterministic_id(&self) -> String
Returns the deterministic id of this engine.
Sourcepub fn default_features_for_backend(
backend: &BackendKind,
target: &Target,
) -> Features
pub fn default_features_for_backend( backend: &BackendKind, target: &Target, ) -> Features
Returns the default WebAssembly features supported by this backend for a given target.
These are the features that will be enabled by default without any user configuration.
Sourcepub fn supported_features_for_backend(
backend: &BackendKind,
target: &Target,
) -> Features
pub fn supported_features_for_backend( backend: &BackendKind, target: &Target, ) -> Features
Returns all WebAssembly features supported by the specified backend for a given target.
This static method allows checking features for any backend, not just the current one.
Sourcepub fn with_opts(
&mut self,
suggested_opts: &UserCompilerOptimizations,
) -> Result<(), CompileError>
pub fn with_opts( &mut self, suggested_opts: &UserCompilerOptimizations, ) -> Result<(), CompileError>
Add suggested optimizations to this engine.
§Note
Not every backend supports every optimization. This function may fail (i.e. not set the suggested optimizations) silently if the underlying engine backend does not support one or more optimizations.
Source§impl Engine
impl Engine
Sourcepub fn into_sys(self) -> Engine
pub fn into_sys(self) -> Engine
Consume self into a crate::backend::sys::engine::Engine.
Sourcepub fn as_sys(&self) -> &Engine
pub fn as_sys(&self) -> &Engine
Convert a reference to self into a reference crate::backend::sys::engine::Engine.
Sourcepub fn as_sys_mut(&mut self) -> &mut Engine
pub fn as_sys_mut(&mut self) -> &mut Engine
Convert a mutable reference to self into a mutable reference crate::backend::sys::engine::Engine.
Trait Implementations§
Source§impl AsEngineRef for Engine
impl AsEngineRef for Engine
Source§impl From<EngineBuilder> for Engine
impl From<EngineBuilder> for Engine
Source§fn from(value: EngineBuilder) -> Engine
fn from(value: EngineBuilder) -> Engine
Source§impl NativeEngineExt for Engine
impl NativeEngineExt for Engine
Source§fn new(
compiler_config: Box<dyn CompilerConfig>,
target: Target,
features: Features,
) -> Engine
fn new( compiler_config: Box<dyn CompilerConfig>, target: Target, features: Features, ) -> Engine
Engine with the given configSource§fn set_tunables(&mut self, tunables: impl Tunables + Send + Sync + 'static)
fn set_tunables(&mut self, tunables: impl Tunables + Send + Sync + 'static)
Source§unsafe fn deserialize_from_mmapped_file_unchecked(
&self,
file_ref: &Path,
) -> Result<Module, DeserializeError>
unsafe fn deserialize_from_mmapped_file_unchecked( &self, file_ref: &Path, ) -> Result<Module, DeserializeError>
Source§unsafe fn deserialize_from_mmapped_file(
&self,
file_ref: &Path,
) -> Result<Module, DeserializeError>
unsafe fn deserialize_from_mmapped_file( &self, file_ref: &Path, ) -> Result<Module, DeserializeError>
Source§fn set_hash_algorithm(&mut self, hash_algorithm: Option<HashAlgorithm>)
fn set_hash_algorithm(&mut self, hash_algorithm: Option<HashAlgorithm>)
Auto Trait Implementations§
impl Freeze for Engine
impl !RefUnwindSafe for Engine
impl Send for Engine
impl Sync for Engine
impl Unpin for Engine
impl !UnwindSafe for Engine
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.