[][src]Enum rune::IrValue

pub enum IrValue {
    Unit,
    Byte(u8),
    Char(char),
    Bool(bool),
    Integer(BigInt),
    Float(f64),
    String(Shared<String>),
    Option(Shared<Option<IrValue>>),
    Bytes(Shared<Vec<u8>>),
    Vec(Shared<Vec<IrValue>>),
    Tuple(Shared<Box<[IrValue]>>),
    Object(Shared<HashMap<String, IrValue>>),
}

A constant value.

Variants

Unit

A constant unit.

Byte(u8)

A byte.

Char(char)

A character.

Bool(bool)

A boolean constant value.

Integer(BigInt)

An integer constant.

Float(f64)

An float constant.

String(Shared<String>)

A string constant designated by its slot.

An optional value.

Bytes(Shared<Vec<u8>>)

A byte string.

A vector of values.

An anonymous tuple.

An anonymous object.

Implementations

impl IrValue[src]

pub fn from_const(value: ConstValue) -> Self[src]

Convert a constant value into an interpreter value.

pub fn into_const<S>(self, spanned: S) -> Result<ConstValue, IrError> where
    S: Copy + Spanned
[src]

Convert into constant value.

pub fn into_bool(self) -> Result<bool, Self>[src]

Try to coerce into boolean.

pub fn into_integer<T>(self) -> Option<T> where
    T: TryFrom<BigInt>, 
[src]

Try to coerce into an integer of the specified type.

pub fn type_info(&self) -> TypeInfo[src]

Get the type information of the value.

Trait Implementations

impl Clone for IrValue[src]

impl Debug for IrValue[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.