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.

Empty

An empty value.

Implementations

Returns true if self is a Value::String.

Returns true if self is a Value::Int.

Returns true if self is a Value::Float.

Returns true if self is a Value::Int or Value::Float.

Returns true if self is a Value::Boolean.

Returns true if self is a Value::Tuple.

Returns true if self is a Value::Empty.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.