Struct pyodide_webassembly_runtime_layer::Engine

source ·
pub struct Engine { /* private fields */ }
Expand description

Runtime for WebAssembly web runtime.

Trait Implementations§

source§

impl<T> AsContext<Engine> for Store<T>

§

type UserState = T

The type of data associated with the store.
source§

fn as_context(&self) -> StoreContext<'_, T>

Returns the store context that this type provides access to.
source§

impl<'a, T: 'a> AsContext<Engine> for StoreContext<'a, T>

§

type UserState = T

The type of data associated with the store.
source§

fn as_context(&self) -> StoreContext<'_, T>

Returns the store context that this type provides access to.
source§

impl<'a, T: 'a> AsContext<Engine> for StoreContextMut<'a, T>

§

type UserState = T

The type of data associated with the store.
source§

fn as_context(&self) -> StoreContext<'_, T>

Returns the store context that this type provides access to.
source§

impl<T> AsContextMut<Engine> for Store<T>

source§

fn as_context_mut(&mut self) -> StoreContextMut<'_, T>

Returns the store context that this type provides access to.
source§

impl<'a, T: 'a> AsContextMut<Engine> for StoreContextMut<'a, T>

source§

fn as_context_mut(&mut self) -> StoreContextMut<'_, T>

Returns the store context that this type provides access to.
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() -> Engine

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

impl WasmEngine for Engine

§

type ExternRef = ExternRef

The external reference type.
§

type Func = Func

The function type.
§

type Global = Global

The global type.
§

type Instance = Instance

The instance type.
§

type Memory = Memory

The memory type.
§

type Module = Module

The module type.
§

type Store<T> = Store<T>

The store type.
§

type StoreContext<'a, T: 'a> = StoreContext<'a, T>

The store context type.
§

type StoreContextMut<'a, T: 'a> = StoreContextMut<'a, T>

The mutable store context type.
§

type Table = Table

The table type.
source§

impl WasmExternRef<Engine> for ExternRef

source§

fn new<T: 'static + Send + Sync>( _ctx: impl AsContextMut<Engine>, object: T ) -> Self

Creates a new reference wrapping the given value.
source§

fn downcast<'a, 's: 'a, T: 'static, S: 's>( &'a self, _ctx: StoreContext<'s, S> ) -> Result<&'a T>

Returns a shared reference to the underlying data.
source§

impl WasmFunc<Engine> for Func

source§

fn new<T>( ctx: impl AsContextMut<Engine, UserState = T>, ty: FuncType, func: impl 'static + Send + Sync + Fn(StoreContextMut<'_, T>, &[Value<Engine>], &mut [Value<Engine>]) -> Result<()> ) -> Self

Creates a new function with the given arguments.
source§

fn ty(&self, _ctx: impl AsContext<Engine>) -> FuncType

Gets the function type of this object.
source§

fn call<T>( &self, ctx: impl AsContextMut<Engine>, args: &[Value<Engine>], results: &mut [Value<Engine>] ) -> Result<()>

Calls the object with the given arguments.
source§

impl WasmGlobal<Engine> for Global

source§

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

Returns the type of the global variable.
source§

fn set( &self, _ctx: impl AsContextMut<Engine>, new_value: Value<Engine> ) -> Result<()>

Sets the value of the global variable.
source§

fn get(&self, _ctx: impl AsContextMut<Engine>) -> Value<Engine>

Gets the value of the global variable.
source§

impl WasmInstance<Engine> for Instance

source§

fn new( _store: impl AsContextMut<Engine>, module: &Module, imports: &Imports<Engine> ) -> Result<Self>

Creates a new instance.
source§

fn exports( &self, _store: impl AsContext<Engine> ) -> Box<dyn Iterator<Item = Export<Engine>>>

Gets the exports of this instance.
source§

fn get_export( &self, _store: impl AsContext<Engine>, name: &str ) -> Option<Extern<Engine>>

Gets the export of the given name, if any, from this instance.
source§

impl WasmMemory<Engine> for Memory

source§

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

Returns the memory type of the linear memory.
source§

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

Returns the amount of pages in use by the linear memory.
source§

fn read( &self, _ctx: impl AsContext<Engine>, offset: usize, buffer: &mut [u8] ) -> Result<()>

Reads n bytes from memory[offset..offset+n] into buffer where n is the length of buffer.
source§

fn write( &self, _ctx: impl AsContextMut<Engine>, offset: usize, buffer: &[u8] ) -> Result<()>

Writes n bytes to memory[offset..offset+n] from buffer where n if the length of buffer.
source§

impl WasmModule<Engine> for Module

source§

fn new(_engine: &Engine, stream: impl Read) -> Result<Self>

Creates a new module from the given byte stream.
source§

fn exports(&self) -> Box<dyn Iterator<Item = ExportType<'_>> + '_>

Gets the export types of the module.
source§

fn get_export(&self, name: &str) -> Option<ExternType>

Gets the export type of the given name, if any, from this module.
source§

fn imports(&self) -> Box<dyn Iterator<Item = ImportType<'_>> + '_>

Gets the import types of the module.
source§

impl<T> WasmStore<T, Engine> for Store<T>

source§

fn new(engine: &Engine, data: T) -> Self

Creates a new store atop the given engine.
source§

fn engine(&self) -> &Engine

Gets the engine associated with this store.
source§

fn data(&self) -> &T

Gets an immutable reference to the underlying stored data.
source§

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

Gets a mutable reference to the underlying stored data.
source§

fn into_data(self) -> T

Consumes self and returns its user provided data.
source§

impl<'a, T: 'a> WasmStoreContext<'a, T, Engine> for StoreContext<'a, T>

source§

fn engine(&self) -> &Engine

Gets the engine associated with this store.
source§

fn data(&self) -> &T

Gets an immutable reference to the underlying stored data.
source§

impl<'a, T: 'a> WasmStoreContext<'a, T, Engine> for StoreContextMut<'a, T>

source§

fn engine(&self) -> &Engine

Gets the engine associated with this store.
source§

fn data(&self) -> &T

Gets an immutable reference to the underlying stored data.
source§

impl<'a, T: 'a> WasmStoreContextMut<'a, T, Engine> for StoreContextMut<'a, T>

source§

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

Gets a mutable reference to the underlying stored data.
source§

impl WasmTable<Engine> for Table

source§

fn ty(&self, _ctx: impl AsContext<Engine>) -> TableType

Returns the type and limits of the table.

source§

fn size(&self, _ctx: impl AsContext<Engine>) -> u32

Returns the current size of the table.

source§

fn grow( &self, _ctx: impl AsContextMut<Engine>, delta: u32, init: Value<Engine> ) -> Result<u32>

Grows the table by the given amount of elements.

source§

fn get( &self, _ctx: impl AsContextMut<Engine>, index: u32 ) -> Option<Value<Engine>>

Returns the table element value at index.

source§

fn set( &self, _ctx: impl AsContextMut<Engine>, index: u32, value: Value<Engine> ) -> Result<()>

Sets the value of this table at index.

source§

fn new( _ctx: impl AsContextMut<Engine>, ty: TableType, init: Value<Engine> ) -> Result<Self>

Creates a new table to the store.

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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 T
where 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.

source§

impl<T> ToOwned for T
where 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 T
where 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 T
where 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.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> Ungil for T
where T: Send,