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
impl Store
pub fn func_type(&self, addr: u32) -> Option<FuncType>
pub fn alloc_host_func(&mut self, ty: FuncType, id: u32) -> u32
pub fn alloc_memory(&mut self, limits: Limits) -> Result<u32, Trap>
pub fn alloc_table(&mut self, elem_ty: ValType, limits: Limits) -> u32
pub fn alloc_global(&mut self, ty: GlobalType, val: Val) -> u32
Sourcepub fn grow_memory(&mut self, addr: u32, delta: u32) -> i32
pub fn grow_memory(&mut self, addr: u32, delta: u32) -> i32
メモリを delta ページ増やす。戻り値は前のページ数(失敗は -1)。
Sourcepub fn instantiate(
&mut self,
host: &mut dyn Host,
module: Rc<Module>,
imports: &[Extern],
) -> Result<usize, Trap>
pub fn instantiate( &mut self, host: &mut dyn Host, module: Rc<Module>, imports: &[Extern], ) -> Result<usize, Trap>
module をインスタンス化する。imports は取り込みの順に並んだ実体。戻り値はインスタンスの番号。
fn eval_const(&self, inst: usize, e: &ConstExpr) -> Val
Sourcepub fn invoke(
&mut self,
host: &mut dyn Host,
addr: u32,
args: &[Val],
) -> Result<Vec<Val>, Trap>
pub fn invoke( &mut self, host: &mut dyn Host, addr: u32, args: &[Val], ) -> Result<Vec<Val>, Trap>
store の関数 addr を呼ぶ。
fn call( &mut self, host: &mut dyn Host, addr: u32, args: Vec<Val>, depth: usize, ) -> Result<Vec<Val>, Trap>
Trait Implementations§
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> 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