Enum budvm::ir::CompareAction
source · pub enum CompareAction {
Store(Destination),
JumpIfFalse(Label),
}
Expand description
An action to take during an Instruction::Compare
.
Variants§
Store(Destination)
Store the boolean result in the destination indicated.
JumpIfFalse(Label)
If the comparison is false, jump to the 0-based instruction index indicated.
Implementations§
source§impl CompareAction
impl CompareAction
sourcepub fn link(&self, labels: &[Option<usize>]) -> Result<CompareAction, LinkError>
pub fn link(&self, labels: &[Option<usize>]) -> Result<CompareAction, LinkError>
Converts this intermediate representation of a compare action to the
virtual machines CompareAction
.
Trait Implementations§
source§impl Clone for CompareAction
impl Clone for CompareAction
source§fn clone(&self) -> CompareAction
fn clone(&self) -> CompareAction
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 CompareAction
impl Debug for CompareAction
source§impl Display for CompareAction
impl Display for CompareAction
source§impl From<&CompareAction> for CompareAction
impl From<&CompareAction> for CompareAction
source§fn from(value: &CompareAction) -> Self
fn from(value: &CompareAction) -> Self
Converts to this type from the input type.
source§impl From<&Destination> for CompareAction
impl From<&Destination> for CompareAction
source§fn from(value: &Destination) -> Self
fn from(value: &Destination) -> Self
Converts to this type from the input type.
source§impl From<Destination> for CompareAction
impl From<Destination> for CompareAction
source§fn from(value: Destination) -> Self
fn from(value: Destination) -> Self
Converts to this type from the input type.
source§impl PartialEq<CompareAction> for CompareAction
impl PartialEq<CompareAction> for CompareAction
source§fn eq(&self, other: &CompareAction) -> bool
fn eq(&self, other: &CompareAction) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.