Enum lualite::bytecode::constant_value::ConstantValue
source · [−]Expand description
Constant literals in a function
ConstantValue
s are stored in a Procedure
’s constant table. Instructions
from that procedure can refer to its constant values with a ConstantKey
(from bytecode::operand
). A constant key is just an index into that table.
Each procedure has its own table of ConstantValue
s.
A VirtualMachine
can create a runtime Value
directly from a ConstantValue
.
Variants
Integer(i64)
Float(f64)
Boolean(bool)
String(String)
Trait Implementations
sourceimpl Clone for ConstantValue
impl Clone for ConstantValue
sourcefn clone(&self) -> ConstantValue
fn clone(&self) -> ConstantValue
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ConstantValue
impl Debug for ConstantValue
sourceimpl Display for ConstantValue
impl Display for ConstantValue
sourceimpl From<BooleanLiteral> for ConstantValue
impl From<BooleanLiteral> for ConstantValue
sourcefn from(boolean: BooleanLiteral) -> Self
fn from(boolean: BooleanLiteral) -> Self
Converts to this type from the input type.
sourceimpl From<ConstantValue> for Value
impl From<ConstantValue> for Value
sourcefn from(constant_value: ConstantValue) -> Value
fn from(constant_value: ConstantValue) -> Value
Converts to this type from the input type.
sourceimpl From<FloatLiteral> for ConstantValue
impl From<FloatLiteral> for ConstantValue
sourcefn from(float: FloatLiteral) -> Self
fn from(float: FloatLiteral) -> Self
Converts to this type from the input type.
sourceimpl From<IntegerLiteral> for ConstantValue
impl From<IntegerLiteral> for ConstantValue
sourcefn from(integer: IntegerLiteral) -> Self
fn from(integer: IntegerLiteral) -> Self
Converts to this type from the input type.
sourceimpl From<StringLiteral> for ConstantValue
impl From<StringLiteral> for ConstantValue
sourcefn from(string: StringLiteral) -> Self
fn from(string: StringLiteral) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<ConstantValue> for ConstantValue
impl PartialEq<ConstantValue> for ConstantValue
sourcefn eq(&self, other: &ConstantValue) -> bool
fn eq(&self, other: &ConstantValue) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ConstantValue) -> bool
fn ne(&self, other: &ConstantValue) -> bool
This method tests for !=
.
sourceimpl PartialOrd<ConstantValue> for ConstantValue
impl PartialOrd<ConstantValue> for ConstantValue
sourcefn partial_cmp(&self, other: &ConstantValue) -> Option<Ordering>
fn partial_cmp(&self, other: &ConstantValue) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl StructuralPartialEq for ConstantValue
Auto Trait Implementations
impl RefUnwindSafe for ConstantValue
impl Send for ConstantValue
impl Sync for ConstantValue
impl Unpin for ConstantValue
impl UnwindSafe for ConstantValue
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more