[][src]Enum rant::RantValue

pub enum RantValue {
    String(String),
    Float(f64),
    Integer(i64),
    Boolean(bool),
    Function(RantFunctionRef),
    List(RantListRef),
    Map(RantMapRef),
    Special(RantSpecial),
    Empty,
}

A dynamically-typed Rant value.

Cloning

It is important to note that calling clone() on a RantValue will only result in a shallow clone of the data. Since collection types like list and map are represented by handles to their actual contents, cloning these will only make copies of these handles; both copies will still point to the same data.

Variants

String(String)

A Rant value of type string. Passed by-value.

Float(f64)

A Rant value of type float. Passed by-value.

Integer(i64)

A Rant value of type integer. Passed by-value.

Boolean(bool)

A Rant value of type bool. Passed by-value.

Function(RantFunctionRef)

A Rant value of type function. Passed by-reference.

A Rant value of type list. Passed by-reference.

A Rant value of type map. Passed by-reference.

Special(RantSpecial)

A Rant value of type special. Passed by-reference.

Empty

A Rant unit value of type empty. Passed by-value.

Implementations

impl RantValue[src]

pub fn nan() -> Self[src]

Returns NaN (Not a Number).

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

Returns true if the value is of type empty.

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

Returns true if the value is NaN (Not a Number).

impl RantValue[src]

pub fn into_rant_int(self) -> RantValue[src]

pub fn into_rant_float(self) -> RantValue[src]

pub fn into_rant_string(self) -> RantValue[src]

pub fn len(&self) -> usize[src]

pub fn get_type(&self) -> RantValueType[src]

Gets the Rant type associated with the value.

pub fn type_name(&self) -> &'static str[src]

Gets the type name of the value.

pub fn index_get(&self, index: i64) -> ValueIndexResult[src]

Attempts to get a value by index.

pub fn index_set(&mut self, index: i64, val: RantValue) -> ValueIndexSetResult[src]

Attempts to set a value by index.

pub fn key_get(&self, key: &str) -> ValueKeyResult[src]

Attempts to get a value by key.

pub fn key_set(&mut self, key: &str, val: RantValue) -> ValueKeySetResult[src]

Attempts to set a value by key.

Trait Implementations

impl Add<RantValue> for RantValue[src]

type Output = RantValue

The resulting type after applying the + operator.

impl Clone for RantValue[src]

impl Debug for RantValue[src]

impl Default for RantValue[src]

fn default() -> Self[src]

Gets the default RantValue (empty).

impl Display for RantValue[src]

impl Div<RantValue> for RantValue[src]

type Output = ValueResult<RantValue>

The resulting type after applying the / operator.

impl Eq for RantValue[src]

impl FromIterator<RantValue> for RantList[src]

impl FromRant for RantValue[src]

impl Mul<RantValue> for RantValue[src]

type Output = RantValue

The resulting type after applying the * operator.

impl Neg for RantValue[src]

type Output = RantValue

The resulting type after applying the - operator.

impl Not for RantValue[src]

type Output = Self

The resulting type after applying the ! operator.

impl PartialEq<RantValue> for RantValue[src]

impl PartialOrd<RantValue> for RantValue[src]

impl Rem<RantValue> for RantValue[src]

type Output = ValueResult<RantValue>

The resulting type after applying the % operator.

impl Sub<RantValue> for RantValue[src]

type Output = RantValue

The resulting type after applying the - operator.

Auto Trait Implementations

impl !RefUnwindSafe for RantValue

impl !Send for RantValue

impl !Sync for RantValue

impl Unpin for RantValue

impl !UnwindSafe for RantValue

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> ToString for T where
    T: Display + ?Sized
[src]

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,