Enum rurtle::environ::value::Value [] [src]

pub enum Value {
    Nothing,
    Number(f32),
    String(String),
    List(Vec<Value>),
}

Enum combining the possible Rurtle value types

Variants

Nothing
Number
String
List

Methods

impl Value

fn boolean(&self) -> bool

Return the given Value's boolean value. Objects considered true are

  • Numbers different from 0
  • nonempty Strings and Lists

Everything else is considered to be "falsy"

fn type_string(&self) -> &'static str

Return the stringified type of the value

Trait Implementations

impl Display for Value

fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error>

impl<'a> Add for &'a Value

type Output = Option<Value>

fn add(self, other: &Value) -> Option<Value>

impl<'a> Sub for &'a Value

type Output = Option<Value>

fn sub(self, other: &Value) -> Option<Value>

impl<'a> Mul for &'a Value

type Output = Option<Value>

fn mul(self, other: &Value) -> Option<Value>

impl<'a> Div for &'a Value

type Output = Option<Value>

fn div(self, other: &Value) -> Option<Value>

Derived Implementations

impl PartialOrd for Value

fn partial_cmp(&self, __arg_0: &Value) -> Option<Ordering>

fn lt(&self, __arg_0: &Value) -> bool

fn le(&self, __arg_0: &Value) -> bool

fn gt(&self, __arg_0: &Value) -> bool

fn ge(&self, __arg_0: &Value) -> bool

impl PartialEq for Value

fn eq(&self, __arg_0: &Value) -> bool

fn ne(&self, __arg_0: &Value) -> bool

impl Clone for Value

fn clone(&self) -> Value

fn clone_from(&mut self, source: &Self)

impl Debug for Value

fn fmt(&self, __arg_0: &mut Formatter) -> Result