pub struct WatFunction {
pub name: String,
pub params: Vec<(String, WasmType)>,
pub return_type: Option<WasmType>,
pub locals: HashMap<String, WasmType>,
pub locals_counters: HashMap<String, u32>,
pub body: Vec<Box<WatInstruction>>,
}Fields§
§name: String§params: Vec<(String, WasmType)>§return_type: Option<WasmType>§locals: HashMap<String, WasmType>§locals_counters: HashMap<String, u32>§body: Vec<Box<WatInstruction>>Implementations§
Source§impl WatFunction
impl WatFunction
pub fn new(name: impl Into<String>) -> Self
pub fn add_param(&mut self, name: impl Into<String>, type_: &WasmType)
pub fn set_return_type(&mut self, type_: WasmType)
pub fn add_local_exact(&mut self, name: impl Into<String>, type: WasmType)
pub fn add_local(&mut self, name: impl Into<String>, type: WasmType) -> String
pub fn add_instruction(&mut self, instruction: WatInstruction)
Trait Implementations§
Source§impl Clone for WatFunction
impl Clone for WatFunction
Source§impl Debug for WatFunction
impl Debug for WatFunction
Auto Trait Implementations§
impl Freeze for WatFunction
impl RefUnwindSafe for WatFunction
impl Send for WatFunction
impl Sync for WatFunction
impl Unpin for WatFunction
impl UnsafeUnpin for WatFunction
impl UnwindSafe for WatFunction
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