[][src]Struct wasmtime::Engine

pub struct Engine { /* fields omitted */ }

An Engine which is a global context for compilation and management of wasm modules.

An engine can be safely shared across threads and is a cheap cloneable handle to the actual engine. The engine itself will be deallocate once all references to it have gone away.

Engines store global configuration preferences such as compilation settings, enabled features, etc. You'll likely only need at most one of these for a program.

Engines and Clone

Using clone on an Engine is a cheap operation. It will not create an entirely new engine, but rather just a new reference to the existing engine. In other words it's a shallow copy, not a deep copy.

Engines and Default

You can create an engine with default configuration settings using Engine::default(). Be sure to consult the documentation of Config for default settings.

Implementations

impl Engine[src]

pub fn new(config: &Config) -> Engine[src]

Creates a new Engine with the specified compilation and configuration settings.

pub fn config(&self) -> &Config[src]

Returns the configuration settings that this engine is using.

pub fn same(a: &Engine, b: &Engine) -> bool[src]

Returns whether the engine a and b refer to the same configuration.

Trait Implementations

impl Clone for Engine[src]

impl Default for Engine[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.