Struct wasmtime::Engine [−][src]
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
[src]
pub const ALIGN: usize
[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
[src]
pub unsafe fn drop(ptr: usize)
[src]
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,