Skip to main content

Store

Struct Store 

Source
pub struct Store {
    pub funcs: Vec<FuncInst>,
    pub tables: Vec<TableInst>,
    pub mems: Vec<MemInst>,
    pub globals: Vec<GlobalInst>,
    pub instances: Vec<InstData>,
}

Fields§

§funcs: Vec<FuncInst>§tables: Vec<TableInst>§mems: Vec<MemInst>§globals: Vec<GlobalInst>§instances: Vec<InstData>

Implementations§

Source§

impl Store

Source

pub fn func_type(&self, addr: u32) -> Option<FuncType>

Source

pub fn alloc_host_func(&mut self, ty: FuncType, id: u32) -> u32

Source

pub fn alloc_memory(&mut self, limits: Limits) -> Result<u32, Trap>

Source

pub fn alloc_table(&mut self, elem_ty: ValType, limits: Limits) -> u32

Source

pub fn alloc_global(&mut self, ty: GlobalType, val: Val) -> u32

Source

pub fn grow_memory(&mut self, addr: u32, delta: u32) -> i32

メモリを delta ページ増やす。戻り値は前のページ数(失敗は -1)。

Source

pub fn instantiate( &mut self, host: &mut dyn Host, module: Rc<Module>, imports: &[Extern], ) -> Result<usize, Trap>

module をインスタンス化する。imports は取り込みの順に並んだ実体。戻り値はインスタンスの番号。

Source

fn eval_const(&self, inst: usize, e: &ConstExpr) -> Val

Source

pub fn export(&self, inst: usize, name: &str) -> Option<Extern>

インスタンスの書き出しを名前で引く。

Source

pub fn invoke( &mut self, host: &mut dyn Host, addr: u32, args: &[Val], ) -> Result<Vec<Val>, Trap>

store の関数 addr を呼ぶ。

Source

fn call( &mut self, host: &mut dyn Host, addr: u32, args: Vec<Val>, depth: usize, ) -> Result<Vec<Val>, Trap>

Trait Implementations§

Source§

impl Default for Store

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl !RefUnwindSafe for Store

§

impl !Send for Store

§

impl !Sync for Store

§

impl !UnwindSafe for Store

§

impl Freeze for Store

§

impl Unpin for Store

§

impl UnsafeUnpin for Store

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.

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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.