Struct nyar_wasm::JumpBranch
source · pub struct JumpBranch {
pub main: JumpCondition,
pub default: Vec<WasiInstruction>,
pub select: bool,
pub return: Vec<WasiType>,
}
Fields§
§main: JumpCondition
The conditional jump branch
default: Vec<WasiInstruction>
The default jump branch
select: bool
Compile with select
, otherwise if else end
will be used
return: Vec<WasiType>
The return type of the block
Implementations§
source§impl JumpBranch
impl JumpBranch
sourcepub fn if_then(if: Vec<WasiInstruction>, then: Vec<WasiInstruction>) -> Self
pub fn if_then(if: Vec<WasiInstruction>, then: Vec<WasiInstruction>) -> Self
Create a if ... then ... end
branch
sourcepub fn if_then_else(
if: Vec<WasiInstruction>,
then: Vec<WasiInstruction>,
else: Vec<WasiInstruction>
) -> Self
pub fn if_then_else( if: Vec<WasiInstruction>, then: Vec<WasiInstruction>, else: Vec<WasiInstruction> ) -> Self
Create a if ... then ... else ... end
branch
sourcepub fn with_return_type(self, type: Vec<WasiType>) -> Self
pub fn with_return_type(self, type: Vec<WasiType>) -> 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 WasiInstruction
impl From<JumpBranch> for WasiInstruction
source§fn from(value: JumpBranch) -> Self
fn from(value: JumpBranch) -> Self
Converts to this type from the input type.
source§impl Hash for JumpBranch
impl Hash for JumpBranch
source§impl Ord for JumpBranch
impl Ord for JumpBranch
source§fn cmp(&self, other: &JumpBranch) -> Ordering
fn cmp(&self, other: &JumpBranch) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for JumpBranch
impl PartialEq for JumpBranch
source§fn eq(&self, other: &JumpBranch) -> bool
fn eq(&self, other: &JumpBranch) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for JumpBranch
impl PartialOrd for JumpBranch
source§fn partial_cmp(&self, other: &JumpBranch) -> Option<Ordering>
fn partial_cmp(&self, other: &JumpBranch) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for JumpBranch
impl StructuralPartialEq for JumpBranch
Auto Trait Implementations§
impl Freeze for JumpBranch
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
source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.