pub struct Engine(/* private fields */);Expand description
Newtype wrapper around wasmer::Engine.
Implementations§
Source§impl Engine
impl Engine
Sourcepub fn new(inner: Engine) -> Self
pub fn new(inner: Engine) -> Self
Create a wasm_runtime_layer::Engine-compatible Engine from a wasmer::Engine.
Sourcepub fn into_inner(self) -> Engine
pub fn into_inner(self) -> Engine
Consume a Engine to obtain the inner wasmer::Engine.
Methods from Deref<Target = 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.
Sourcepub fn deterministic_id(&self) -> String
pub fn deterministic_id(&self) -> String
Returns the deterministic id of this engine.
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.
Trait Implementations§
Source§impl<T: 'static> AsContext<Engine> for Store<T>
impl<T: 'static> AsContext<Engine> for Store<T>
Source§fn as_context(&self) -> StoreContext<'_, Self::UserState>
fn as_context(&self) -> StoreContext<'_, Self::UserState>
Returns the store context that this type provides access to.
Source§impl<T: 'static> AsContext<Engine> for StoreContext<'_, T>
impl<T: 'static> AsContext<Engine> for StoreContext<'_, T>
Source§fn as_context(&self) -> StoreContext<'_, T>
fn as_context(&self) -> StoreContext<'_, T>
Returns the store context that this type provides access to.
Source§impl<T: 'static> AsContext<Engine> for StoreContextMut<'_, T>
impl<T: 'static> AsContext<Engine> for StoreContextMut<'_, T>
Source§fn as_context(&self) -> StoreContext<'_, T>
fn as_context(&self) -> StoreContext<'_, T>
Returns the store context that this type provides access to.
Source§impl<T: 'static> AsContextMut<Engine> for Store<T>
impl<T: 'static> AsContextMut<Engine> for Store<T>
Source§fn as_context_mut(&mut self) -> StoreContextMut<'_, Self::UserState>
fn as_context_mut(&mut self) -> StoreContextMut<'_, Self::UserState>
Returns the store context that this type provides access to.
Source§impl<T: 'static> AsContextMut<Engine> for StoreContextMut<'_, T>
impl<T: 'static> AsContextMut<Engine> for StoreContextMut<'_, T>
Source§fn as_context_mut(&mut self) -> StoreContextMut<'_, T>
fn as_context_mut(&mut self) -> StoreContextMut<'_, T>
Returns the store context that this type provides access to.
Source§impl WasmEngine for Engine
impl WasmEngine for Engine
Source§type StoreContext<'a, T: 'static> = StoreContext<'a, T>
type StoreContext<'a, T: 'static> = StoreContext<'a, T>
The store context type.
Source§type StoreContextMut<'a, T: 'static> = StoreContextMut<'a, T>
type StoreContextMut<'a, T: 'static> = StoreContextMut<'a, T>
The mutable store context type.
Source§impl WasmExternRef<Engine> for ExternRef
impl WasmExternRef<Engine> for ExternRef
Source§impl WasmFunc<Engine> for Func
impl WasmFunc<Engine> for Func
Source§impl WasmGlobal<Engine> for Global
impl WasmGlobal<Engine> for Global
Source§fn new(
ctx: impl AsContextMut<Engine>,
value: Value<Engine>,
mutable: bool,
) -> Self
fn new( ctx: impl AsContextMut<Engine>, value: Value<Engine>, mutable: bool, ) -> Self
Creates a new global variable to the store.
Source§fn ty(&self, ctx: impl AsContext<Engine>) -> GlobalType
fn ty(&self, ctx: impl AsContext<Engine>) -> GlobalType
Returns the type of the global variable.
Source§impl WasmInstance<Engine> for Instance
impl WasmInstance<Engine> for Instance
Source§impl WasmMemory<Engine> for Memory
impl WasmMemory<Engine> for Memory
Source§fn new(ctx: impl AsContextMut<Engine>, ty: MemoryType) -> Result<Self>
fn new(ctx: impl AsContextMut<Engine>, ty: MemoryType) -> Result<Self>
Creates a new linear memory to the store.
Source§fn ty(&self, ctx: impl AsContext<Engine>) -> MemoryType
fn ty(&self, ctx: impl AsContext<Engine>) -> MemoryType
Returns the memory type of the linear memory.
Source§fn grow(&self, ctx: impl AsContextMut<Engine>, additional: u32) -> Result<u32>
fn grow(&self, ctx: impl AsContextMut<Engine>, additional: u32) -> Result<u32>
Grows the linear memory by the given amount of new pages.
Source§fn current_pages(&self, ctx: impl AsContext<Engine>) -> u32
fn current_pages(&self, ctx: impl AsContext<Engine>) -> u32
Returns the amount of pages in use by the linear memory.
Source§impl WasmModule<Engine> for Module
impl WasmModule<Engine> for Module
Source§fn new(engine: &Engine, bytes: &[u8]) -> Result<Self>
fn new(engine: &Engine, bytes: &[u8]) -> Result<Self>
Creates a new module from the given byte slice.
Source§fn exports(&self) -> Box<dyn Iterator<Item = ExportType<'_>> + '_>
fn exports(&self) -> Box<dyn Iterator<Item = ExportType<'_>> + '_>
Gets the export types of the module.
Source§fn get_export(&self, name: &str) -> Option<ExternType>
fn get_export(&self, name: &str) -> Option<ExternType>
Gets the export type of the given name, if any, from this module.
Source§impl<'a, T: 'static> WasmStoreContext<'a, T, Engine> for StoreContext<'a, T>
impl<'a, T: 'static> WasmStoreContext<'a, T, Engine> for StoreContext<'a, T>
Source§impl<'a, T: 'static> WasmStoreContext<'a, T, Engine> for StoreContextMut<'a, T>
impl<'a, T: 'static> WasmStoreContext<'a, T, Engine> for StoreContextMut<'a, T>
Source§impl<'a, T: 'static> WasmStoreContextMut<'a, T, Engine> for StoreContextMut<'a, T>
impl<'a, T: 'static> WasmStoreContextMut<'a, T, Engine> for StoreContextMut<'a, T>
Source§impl WasmTable<Engine> for Table
impl WasmTable<Engine> for Table
Source§fn new(
ctx: impl AsContextMut<Engine>,
ty: TableType,
init: Value<Engine>,
) -> Result<Self>
fn new( ctx: impl AsContextMut<Engine>, ty: TableType, init: Value<Engine>, ) -> Result<Self>
Creates a new table to the store.
Source§fn ty(&self, ctx: impl AsContext<Engine>) -> TableType
fn ty(&self, ctx: impl AsContext<Engine>) -> TableType
Returns the type and limits of the table.
Source§fn grow(
&self,
ctx: impl AsContextMut<Engine>,
delta: u32,
init: Value<Engine>,
) -> Result<u32>
fn grow( &self, ctx: impl AsContextMut<Engine>, delta: u32, init: Value<Engine>, ) -> Result<u32>
Grows the table by the given amount of elements.
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 = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<P> AsEngineRef for P
impl<P> AsEngineRef for P
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
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>
Converts
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>
Converts
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>
Returns the layout of the type.
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
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Upcastable for T
impl<T> Upcastable for T
Source§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
Source§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref