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

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

Represents an evaluated value.

Variants

Boolean(bool)

A boolean value.

Integer(i32)

An integer value.

Text(String)

A string value.

Implementations

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 addition operation.

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

Performs a subtraction operation.

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

Performs a multiplication.

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

Performs an integer division.

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

Performs a modulo operation.

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

Performs an integer negation.

Trait Implementations

impl Clone for Value[src]

impl Debug for Value[src]

impl PartialEq<Value> for Value[src]

impl StructuralPartialEq for Value[src]

impl ToString for Value[src]

Auto Trait Implementations

impl RefUnwindSafe for Value

impl Send for Value

impl Sync for Value

impl Unpin for Value

impl UnwindSafe for Value

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.