Enum runestick::ConstValue[][src]

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

A constant value.

Variants

Unit

A constant unit.

Byte(u8)

A byte.

Char(char)

A character.

Bool(bool)

A boolean constant value.

Integer(i64)

An integer constant.

Float(f64)

An float constant.

String(String)

A string constant designated by its slot.

StaticString(Arc<StaticString>)

A static string.

Bytes(Bytes)

A byte string.

A vector of values.

An anonymous tuple.

An anonymous object.

An option.

Implementations

impl ConstValue[src]

pub fn into_value(self) -> Value[src]

Convert into virtual machine value.

We provide this associated method since a constant value can be converted into a value infallibly, which is not captured by the trait otherwise.

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

Try to coerce into boolean.

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

Get the type information of the value.

Trait Implementations

impl Clone for ConstValue[src]

impl Debug for ConstValue[src]

impl<'de> Deserialize<'de> for ConstValue[src]

Deserialize implementation for value.

impl FromValue for ConstValue[src]

impl Serialize for ConstValue[src]

Serialize implementation for value.

impl ToValue for ConstValue[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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[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.