Struct wasmer::Engine

source ·
pub struct Engine(_);
Expand description

The engine type

Implementations§

source§

impl Engine

source

pub fn cloned(&self) -> Self

👎Deprecated since 3.2.0: engine.cloned() has been deprecated in favor of engine.clone()

Returns the Engine.

source

pub fn deterministic_id(&self) -> &str

Returns the deterministic id of this engine

source

pub fn new( compiler_config: Box<dyn CompilerConfig>, target: Target, features: Features ) -> Self

👎Deprecated since 3.2.0

Create a new Engine with the given config

source

pub fn headless() -> Self

Create a headless Engine Will be removed in 4.0 in favor of the NativeEngineExt trait

source

pub fn inner(&self) -> MutexGuard<'_, EngineInner>

👎Deprecated since 3.2.0

Get reference to EngineInner.

source

pub fn inner_mut(&self) -> MutexGuard<'_, EngineInner>

👎Deprecated since 3.2.0

Get mutable reference to EngineInner.

source

pub fn target(&self) -> &Target

Gets the target Will be removed in 4.0 in favor of the NativeEngineExt trait

source

pub fn register_signature( &self, func_type: &FunctionType ) -> VMSharedSignatureIndex

👎Deprecated since 3.2.0

Register a signature

source

pub fn lookup_signature( &self, sig: VMSharedSignatureIndex ) -> Option<FunctionType>

👎Deprecated since 3.2.0

Lookup a signature

source

pub fn validate(&self, binary: &[u8]) -> Result<(), CompileError>

👎Deprecated since 3.2.0

Validates a WebAssembly module

source

pub fn compile(&self, binary: &[u8]) -> Result<Arc<Artifact>, CompileError>

👎Deprecated since 3.2.0

Compile a WebAssembly binary

source

pub unsafe fn deserialize( &self, bytes: &[u8] ) -> Result<Arc<Artifact>, DeserializeError>

👎Deprecated since 3.2.0

Deserializes a WebAssembly module

Safety

The serialized content must represent a serialized WebAssembly module.

source

pub unsafe fn deserialize_from_file( &self, file_ref: &Path ) -> Result<Arc<Artifact>, DeserializeError>

👎Deprecated since 3.2.0

Deserializes a WebAssembly module from a path

Safety

The file’s content must represent a serialized WebAssembly module.

source

pub fn id(&self) -> &str

👎Deprecated since 3.2.0: Use Engine::deterministic_id()

A unique identifier for this object.

This exists to allow us to compare two Engines for equality. Otherwise, comparing two trait objects unsafely relies on implementation details of trait representation.

source

pub fn set_tunables(&mut self, tunables: impl Tunables + Send + Sync + 'static)

Attach a Tunable to this engine Will be removed in 4.0 in favor of the NativeEngineExt trait

source

pub fn tunables(&self) -> &dyn Tunables

Get a reference to attached Tunable of this engine Will be removed in 4.0 in favor of the NativeEngineExt trait

Trait Implementations§

source§

impl AsEngineRef for Engine

source§

fn as_engine_ref(&self) -> EngineRef<'_>

Returns a EngineRef pointing to the underlying context.
source§

impl Clone for Engine

source§

fn clone(&self) -> Engine

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Engine

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Engine

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<T: Into<Engine>> From<T> for Engine

source§

fn from(t: T) -> Self

Converts to this type from the input type.
source§

impl NativeEngineExt for Engine

source§

fn new( compiler_config: Box<dyn CompilerConfig>, target: Target, features: Features ) -> Self

Create a new Engine with the given config
source§

fn headless() -> Self

Create a headless Engine Read more
source§

fn target(&self) -> &Target

Gets the target
source§

fn set_tunables(&mut self, tunables: impl Tunables + Send + Sync + 'static)

Attach a Tunable to this engine
source§

fn tunables(&self) -> &dyn Tunables

Get a reference to attached Tunable of this engine

Auto Trait Implementations§

§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

§

fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> LayoutRaw for T

§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Upcastable for Twhere T: Any + Send + Sync + 'static,

source§

fn upcast_any_ref(&self) -> &(dyn Any + 'static)

upcast ref
source§

fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)

upcast mut ref
source§

fn upcast_any_box(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>

upcast boxed dyn
source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more