Enum evalexpr::Value [−][src]
pub enum Value { String(String), Float(FloatType), Int(IntType), Boolean(bool), Tuple(TupleType), Empty, }
Expand description
The value type used by the parser. Values can be of different subtypes that are the variants of this enum.
Variants
String(String)
A string value.
Float(FloatType)
A float value.
Int(IntType)
An integer value.
Boolean(bool)
A boolean value.
Tuple(TupleType)
A tuple value.
An empty value.
Implementations
Returns true if self
is a Value::Boolean
.
Clones the value stored in self
as String
, or returns Err
if self
is not a Value::String
.
Clones the value stored in self
as IntType
, or returns Err
if self
is not a Value::Int
.
Clones the value stored in self
as FloatType
, or returns Err
if self
is not a Value::Float
.
Clones the value stored in self
as FloatType
, or returns Err
if self
is not a Value::Float
or Value::Int
.
Note that this method silently converts IntType
to FloatType
, if self
is a Value::Int
.
Clones the value stored in self
as bool
, or returns Err
if self
is not a Value::Boolean
.
Clones the value stored in self
as TupleType
, or returns Err
if self
is not a Value::Tuple
.
Clones the value stored in self
as TupleType
or returns Err
if self
is not a Value::Tuple
of the required length.
Returns ()
, or returnsErr
if self
is not a Value::Tuple
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Value
impl UnwindSafe for Value
Blanket Implementations
Mutably borrows from an owned value. Read more