Enum endbasic_core::ast::Value[][src]

pub enum Value {
    Boolean(bool),
    Double(f64),
    Integer(i32),
    Text(String),
}

Represents an evaluated value.

Variants

Boolean(bool)

A boolean value.

Double(f64)

A double-precision floating point value.

Integer(i32)

An integer value.

Text(String)

A string value.

Implementations

impl Value[src]

pub fn as_vartype(&self) -> VarType[src]

Returns the type of the value as a VarType.

impl Value[src]

pub fn parse_as<T: Into<String>>(vtype: VarType, s: T) -> Result<Value>[src]

Parses a string s and constructs a Value that matches a given VarType.

pub fn and(&self, other: &Self) -> Result<Self>[src]

Performs a logical "and" operation.

pub fn or(&self, other: &Self) -> Result<Self>[src]

Performs a logical "or" operation.

pub fn xor(&self, other: &Self) -> Result<Self>[src]

Performs a logical "xor" operation.

pub fn not(&self) -> Result<Self>[src]

Performs a logical "not" operation.

pub fn eq(&self, other: &Self) -> Result<Self>[src]

Performs an equality check.

pub fn ne(&self, other: &Self) -> Result<Self>[src]

Performs an inequality check.

pub fn lt(&self, other: &Self) -> Result<Self>[src]

Performs a less-than check.

pub fn le(&self, other: &Self) -> Result<Self>[src]

Performs a less-than or equal-to check.

pub fn gt(&self, other: &Self) -> Result<Self>[src]

Performs a greater-than check.

pub fn ge(&self, other: &Self) -> Result<Self>[src]

Performs a greater-than or equal to check.

pub fn add(&self, other: &Self) -> Result<Self>[src]

Performs an arithmetic addition.

pub fn sub(&self, other: &Self) -> Result<Self>[src]

Performs an arithmetic subtraction.

pub fn mul(&self, other: &Self) -> Result<Self>[src]

Performs a multiplication.

pub fn div(&self, other: &Self) -> Result<Self>[src]

Performs an arithmetic division.

pub fn modulo(&self, other: &Self) -> Result<Self>[src]

Performs a modulo operation.

pub fn neg(&self) -> Result<Self>[src]

Performs an arithmetic negation.

Trait Implementations

impl Clone for Value[src]

impl Debug for Value[src]

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

impl From<bool> for Value[src]

impl From<f64> for Value[src]

impl From<i32> for Value[src]

impl PartialEq<Value> for Value[src]

impl StructuralPartialEq for Value[src]

impl ToString for Value[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.