pub struct WasiProgramBuilder { /* private fields */ }Expand description
WasiProgram 的构建器
Implementations§
Source§impl WasiProgramBuilder
impl WasiProgramBuilder
Sourcepub fn new(program_type: WasiProgramType) -> Self
pub fn new(program_type: WasiProgramType) -> Self
创建一个新的 WasiProgramBuilder
Sourcepub fn with_function_type(self, func_type: WasiFunctionType) -> Self
pub fn with_function_type(self, func_type: WasiFunctionType) -> Self
添加函数类型定义
Sourcepub fn with_function(self, function: WasiFunction) -> Self
pub fn with_function(self, function: WasiFunction) -> Self
添加函数定义
Sourcepub fn with_export(self, export: WasiExport) -> Self
pub fn with_export(self, export: WasiExport) -> Self
添加导出定义
Sourcepub fn with_import(self, import: WasiImport) -> Self
pub fn with_import(self, import: WasiImport) -> Self
添加导入定义
Sourcepub fn with_memory(self, memory: WasiMemory) -> Self
pub fn with_memory(self, memory: WasiMemory) -> Self
添加内存定义
Sourcepub fn with_table(self, table: WasiTable) -> Self
pub fn with_table(self, table: WasiTable) -> Self
添加表定义
Sourcepub fn with_global(self, global: WasiGlobal) -> Self
pub fn with_global(self, global: WasiGlobal) -> Self
添加全局变量定义
Sourcepub fn with_custom_section(self, custom_section: WasiCustomSection) -> Self
pub fn with_custom_section(self, custom_section: WasiCustomSection) -> Self
添加自定义段
Sourcepub fn with_start_function(self, start_function_index: u32) -> Self
pub fn with_start_function(self, start_function_index: u32) -> Self
设置起始函数索引
Sourcepub fn with_component_item(self, item: WasiComponentItem) -> Self
pub fn with_component_item(self, item: WasiComponentItem) -> Self
添加组件项目
Sourcepub fn with_core_module(self, core_module: WasiCoreModule) -> Self
pub fn with_core_module(self, core_module: WasiCoreModule) -> Self
添加核心模块
Sourcepub fn with_instance(self, instance: WasiInstance) -> Self
pub fn with_instance(self, instance: WasiInstance) -> Self
添加实例
Sourcepub fn with_alias(self, alias: WasiAlias) -> Self
pub fn with_alias(self, alias: WasiAlias) -> Self
添加别名
Sourcepub fn with_symbol(
self,
name: impl Into<String>,
symbol_type: WasiSymbolType,
index: u32,
) -> Self
pub fn with_symbol( self, name: impl Into<String>, symbol_type: WasiSymbolType, index: u32, ) -> Self
添加符号到符号表
Sourcepub fn build(self) -> Result<WasiProgram>
pub fn build(self) -> Result<WasiProgram>
构建 WasiProgram 实例
Auto Trait Implementations§
impl Freeze for WasiProgramBuilder
impl RefUnwindSafe for WasiProgramBuilder
impl Send for WasiProgramBuilder
impl Sync for WasiProgramBuilder
impl Unpin for WasiProgramBuilder
impl UnwindSafe for WasiProgramBuilder
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