[][src]Enum evalexpr::Value

pub enum Value {
    String(String),
    Float(f64),
    Int(i64),
    Boolean(bool),
    Tuple(Vec<Value>),
}

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(f64)

A float value.

Int(i64)

An integer value.

Boolean(bool)

A boolean value.

Tuple(Vec<Value>)

A tuple value.

Methods

impl Value[src]

pub fn is_int(&self) -> bool[src]

Returns true if self is a Value::Int.

pub fn is_float(&self) -> bool[src]

Returns true if self is a Value::Float.

pub fn as_int(&self) -> Result<i64, Error>[src]

Returns self as a IntType, or Err if self is not a Value::Int.

pub fn as_float(&self) -> Result<f64, Error>[src]

Returns self as a FloatType, or Err if self is not a Value::Float or Value::Int.

Trait Implementations

impl PartialEq<Value> for Value[src]

impl From<String> for Value[src]

impl<'_> From<&'_ str> for Value[src]

impl From<f64> for Value[src]

impl From<i64> for Value[src]

impl From<bool> for Value[src]

impl From<Vec<Value>> for Value[src]

impl From<Value> for Result<Value, Error>[src]

impl Clone for Value[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Display for Value[src]

impl Debug for Value[src]

Auto Trait Implementations

impl Send for Value

impl Sync for Value

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.