#[repr(C)]pub struct Program {
pub sections: Vec<Section>,
}
Fields§
§sections: Vec<Section>
Implementations§
Source§impl Program
impl Program
pub fn new() -> Self
pub fn find_exported_function<'a>( &'a self, name: &str, ) -> Result<&'a Export, &'static str>
pub fn find_code_block<'a>( &'a self, index: usize, ) -> Result<&'a CodeBlock, &'static str>
pub fn create_import<'a>( &'a mut self, name: &str, inputs: &[ValueType], outputs: &[ValueType], ) -> Result<usize, &'static str>
pub fn create_export<'a>( &'a mut self, name: &str, inputs: &[ValueType], outputs: &[ValueType], ) -> Result<(&'a mut CodeBlock, usize), &'static str>
pub fn create_function<'a>( &'a mut self, inputs: &[ValueType], outputs: &[ValueType], ) -> Result<(&'a mut CodeBlock, usize), &'static str>
pub fn create_memory<'a>( &'a mut self, name: &str, min: usize, max: Option<usize>, ) -> Result<(&'a mut WasmMemory, usize), &'static str>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Program
impl<'de> Deserialize<'de> for Program
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl InterpretableProgram for Program
impl InterpretableProgram for Program
fn import_fn_details( &self, index: usize, ) -> Result<(&str, &str, usize), &'static str>
fn load_data_into_memory(&self, mem: &mut Vec<u8>) -> Result<(), &'static str>
fn initial_memory_size(&self) -> usize
fn import_fn_count(&self) -> usize
fn fetch_export_fn_index( &self, name: &str, ) -> Result<(usize, usize), &'static str>
fn fetch_instruction<'a>( &'a self, position: &[usize], ) -> Result<Option<&'a Instruction>, &'static str>
fn create_locals( &self, position: &[usize], ) -> Result<Vec<WasmValue>, &'static str>
impl StructuralPartialEq for Program
Auto Trait Implementations§
impl Freeze for Program
impl RefUnwindSafe for Program
impl Send for Program
impl Sync for Program
impl Unpin for Program
impl UnwindSafe for Program
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