Enum runestick::ConstValue[][src]

pub enum ConstValue {
Show 13 variants 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>>),
}
Expand description

A constant value.

Variants

Unit

A constant unit.

Byte

A byte.

Tuple Fields of Byte

0: u8
Char

A character.

Tuple Fields of Char

0: char
Bool

A boolean constant value.

Tuple Fields of Bool

0: bool
Integer

An integer constant.

Tuple Fields of Integer

0: i64
Float

An float constant.

Tuple Fields of Float

0: f64
String

A string constant designated by its slot.

Tuple Fields of String

0: String
StaticString

A static string.

Tuple Fields of StaticString

0: Arc<StaticString>
Bytes

A byte string.

Tuple Fields of Bytes

0: Bytes
Vec

A vector of values.

Tuple Fields of Vec

0: Vec<ConstValue>
Tuple

An anonymous tuple.

Tuple Fields of Tuple

0: Box<[ConstValue]>
Object

An anonymous object.

Tuple Fields of Object

0: HashMap<String, ConstValue>
Option

An option.

Tuple Fields of Option

0: Option<Box<ConstValue>>

Implementations

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.

Try to coerce into boolean.

Get the type information of the value.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize implementation for value.

Deserialize this value from the given Serde deserializer. Read more

Try to convert to the given type, from the given value.

Serialize implementation for value.

Serialize this value into the given Serde serializer. Read more

Convert into a value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.