Enum budvm::ir::LiteralOrSource
source · pub enum LiteralOrSource {
Literal(Literal),
Argument(Argument),
Variable(Variable),
Stack,
}
Expand description
A literal value or a location of a value
Variants§
Literal(Literal)
A literal.
Argument(Argument)
The value is in an argument at the provided 0-based index.
Variable(Variable)
The value is in a variable specified.
Stack
The value is popped from the stack
The order of popping is the order the fields apear in the Instruction
Implementations§
source§impl LiteralOrSource
impl LiteralOrSource
sourcepub fn instantiate<Env>(&self) -> ValueOrSourcewhere
Env: Environment,
pub fn instantiate<Env>(&self) -> ValueOrSourcewhere Env: Environment,
Instantiates this into a ValueOrSource
, promoting Literal
s to
Value
s.
Trait Implementations§
source§impl Clone for LiteralOrSource
impl Clone for LiteralOrSource
source§fn clone(&self) -> LiteralOrSource
fn clone(&self) -> LiteralOrSource
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 LiteralOrSource
impl Debug for LiteralOrSource
source§impl Display for LiteralOrSource
impl Display for LiteralOrSource
source§impl<'a> From<&'a Argument> for LiteralOrSource
impl<'a> From<&'a Argument> for LiteralOrSource
source§impl<'a> From<&'a Literal> for LiteralOrSource
impl<'a> From<&'a Literal> for LiteralOrSource
source§impl<'a> From<&'a Variable> for LiteralOrSource
impl<'a> From<&'a Variable> for LiteralOrSource
source§impl From<&str> for LiteralOrSource
impl From<&str> for LiteralOrSource
source§impl From<Argument> for LiteralOrSource
impl From<Argument> for LiteralOrSource
source§impl From<Literal> for LiteralOrSource
impl From<Literal> for LiteralOrSource
source§impl From<String> for LiteralOrSource
impl From<String> for LiteralOrSource
source§impl From<Variable> for LiteralOrSource
impl From<Variable> for LiteralOrSource
source§impl From<bool> for LiteralOrSource
impl From<bool> for LiteralOrSource
source§impl From<f64> for LiteralOrSource
impl From<f64> for LiteralOrSource
source§impl From<i64> for LiteralOrSource
impl From<i64> for LiteralOrSource
source§impl PartialEq<LiteralOrSource> for LiteralOrSource
impl PartialEq<LiteralOrSource> for LiteralOrSource
source§fn eq(&self, other: &LiteralOrSource) -> bool
fn eq(&self, other: &LiteralOrSource) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.