pub struct Engine { /* private fields */ }Expand description
A compiled-code and runtime environment, shared across Stores and threads.
Cheap to clone (reference-counted handle), Send + Sync — mirrors wasmtime::Engine.
Implementations§
Source§impl Engine
impl Engine
Sourcepub fn new(config: &Config) -> Result<Engine>
pub fn new(config: &Config) -> Result<Engine>
Creates a new Engine from the given configuration.
Sourcepub fn precompile_module(&self, bytes: &[u8]) -> Result<Vec<u8>>
pub fn precompile_module(&self, bytes: &[u8]) -> Result<Vec<u8>>
Compiles bytes and returns the serialized compiled artifact (as
[Module::serialize]), suitable for unsafe Module::deserialize. Validates +
compiles once here so deserialize can skip both.
Sourcepub fn increment_epoch(&self)
pub fn increment_epoch(&self)
Bumps the epoch counter; pairs with Store::set_epoch_deadline.
Sourcepub fn weak(&self) -> EngineWeak
pub fn weak(&self) -> EngineWeak
Returns a non-owning handle to this engine (e.g. for an epoch ticker thread).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Engine
impl RefUnwindSafe for Engine
impl Send for Engine
impl Sync for Engine
impl Unpin for Engine
impl UnsafeUnpin for Engine
impl UnwindSafe for Engine
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
Mutably borrows from an owned value. Read more