Struct nyar_wasm::JumpBranch
source · pub struct JumpBranch {
pub main: JumpCondition,
pub default: Vec<Operation>,
pub select: bool,
pub return: Vec<WasmType>,
}Fields§
§main: JumpConditionThe conditional jump branch
default: Vec<Operation>The default jump branch
select: boolCompile with select, otherwise if else end will be used
return: Vec<WasmType>The return type of the block
Implementations§
source§impl JumpBranch
impl JumpBranch
sourcepub fn if_then(if: Vec<Operation>, then: Vec<Operation>) -> Self
pub fn if_then(if: Vec<Operation>, then: Vec<Operation>) -> Self
Create a if ... then ... end branch
sourcepub fn if_then_else(
if: Vec<Operation>,
then: Vec<Operation>,
else: Vec<Operation>
) -> Self
pub fn if_then_else( if: Vec<Operation>, then: Vec<Operation>, else: Vec<Operation> ) -> Self
Create a if ... then ... else ... end branch
sourcepub fn with_return_type(self, type: Vec<WasmType>) -> Self
pub fn with_return_type(self, type: Vec<WasmType>) -> Self
Set the return type of the if statement
sourcepub fn with_parallel(self, select: bool) -> Self
pub fn with_parallel(self, select: bool) -> Self
Whether to execute branches in parallel
Trait Implementations§
source§impl Clone for JumpBranch
impl Clone for JumpBranch
source§fn clone(&self) -> JumpBranch
fn clone(&self) -> JumpBranch
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for JumpBranch
impl Debug for JumpBranch
source§impl From<JumpBranch> for Operation
impl From<JumpBranch> for Operation
source§fn from(value: JumpBranch) -> Self
fn from(value: JumpBranch) -> Self
Converts to this type from the input type.
source§impl WasmInstruction for JumpBranch
impl WasmInstruction for JumpBranch
source§fn emit<'a, 'i>(&'a self, w: &mut Vec<Instruction<'i>>)where
'a: 'i,
fn emit<'a, 'i>(&'a self, w: &mut Vec<Instruction<'i>>)where
'a: 'i,
if { then } else { else } end
{ then } { else } condition select
Auto Trait Implementations§
impl RefUnwindSafe for JumpBranch
impl Send for JumpBranch
impl Sync for JumpBranch
impl Unpin for JumpBranch
impl UnwindSafe for JumpBranch
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