Enum runestick::Value[][src]

pub enum Value {
Show 28 variants Unit, Bool(bool), Byte(u8), Char(char), Integer(i64), Float(f64), Type(Hash), StaticString(Arc<StaticString>), String(Shared<String>), Bytes(Shared<Bytes>), Vec(Shared<Vec>), Tuple(Shared<Tuple>), Object(Shared<Object>), Range(Shared<Range>), Future(Shared<Future>), Stream(Shared<Stream>), Generator(Shared<Generator>), GeneratorState(Shared<GeneratorState>), Option(Shared<Option<Value>>), Result(Shared<Result<Value, Value>>), UnitStruct(Shared<UnitStruct>), TupleStruct(Shared<TupleStruct>), Struct(Shared<Struct>), Variant(Shared<Variant>), Function(Shared<Function>), Format(Box<Format>), Iterator(Shared<Iterator>), Any(Shared<AnyObj>),
}
Expand description

An entry on the stack.

Variants

Unit

The unit value.

Bool

A boolean.

Tuple Fields of Bool

0: bool
Byte

A single byte.

Tuple Fields of Byte

0: u8
Char

A character.

Tuple Fields of Char

0: char
Integer

A number.

Tuple Fields of Integer

0: i64
Float

A float.

Tuple Fields of Float

0: f64
Type

A type hash. Describes a type in the virtual machine.

Tuple Fields of Type

0: Hash
StaticString

A static string.

While Rc<str> would’ve been enough to store an unsized str, either Box<str> or String must be used to reduce the size of the type to 8 bytes, to ensure that a stack value is 16 bytes in size.

Rc<str> on the other hand wraps a so-called fat pointer, which is 16 bytes.

Tuple Fields of StaticString

0: Arc<StaticString>
String

A UTF-8 string.

Tuple Fields of String

0: Shared<String>
Bytes

A byte string.

Tuple Fields of Bytes

0: Shared<Bytes>
Vec

A vector containing any values.

Tuple Fields of Vec

0: Shared<Vec>
Tuple

A tuple.

Tuple Fields of Tuple

0: Shared<Tuple>
Object

An object.

Tuple Fields of Object

0: Shared<Object>
Range

A range.

Tuple Fields of Range

0: Shared<Range>
Future

A stored future.

Tuple Fields of Future

0: Shared<Future>
Stream

A Stream.

Tuple Fields of Stream

0: Shared<Stream>
Generator

A stored generator.

Tuple Fields of Generator

0: Shared<Generator>
GeneratorState

Generator state.

Tuple Fields of GeneratorState

0: Shared<GeneratorState>
Option

An empty value indicating nothing.

Tuple Fields of Option

0: Shared<Option<Value>>
Result

A stored result in a slot.

Tuple Fields of Result

0: Shared<Result<Value, Value>>
UnitStruct

An struct with a well-defined type.

Tuple Fields of UnitStruct

0: Shared<UnitStruct>
TupleStruct

A tuple with a well-defined type.

Tuple Fields of TupleStruct

0: Shared<TupleStruct>
Struct

An struct with a well-defined type.

Tuple Fields of Struct

0: Shared<Struct>
Variant

The variant of an enum.

Tuple Fields of Variant

0: Shared<Variant>
Function

A stored function pointer.

Tuple Fields of Function

0: Shared<Function>
Format

A value being formatted.

Tuple Fields of Format

0: Box<Format>
Iterator

An iterator.

Tuple Fields of Iterator

0: Shared<Iterator>
Any

An opaque value that can be downcasted.

Tuple Fields of Any

0: Shared<AnyObj>

Implementations

Format the value using the Protocol::STRING_DISPLAY protocol.

Also requires a work buffer buf which will be used in case the value provided required formatting.

Note that this function will always failed if called outside of a virtual machine.

Debug format the value using the Protocol::STRING_DEBUG protocol.

Note that this function will always failed if called outside of a virtual machine.

Convert value into an iterator using the Protocol::INTO_ITER protocol.

Note that this function will always failed if called outside of a virtual machine.

Coerce into future, or convert into a future using the Protocol::INTO_FUTURE protocol.

Note that this function will always failed if called outside of a virtual machine.

Coerce into a shared future, or convert into a future using the Protocol::INTO_FUTURE protocol.

Note that this function will always failed if called outside of a virtual machine.

Retrieves a human readable type name for the current value.

Note that this function will always failed if called outside of a virtual machine.

Construct a vector.

Construct a tuple.

Construct an empty.

Construct a typed tuple.

Construct an empty variant.

Construct a tuple variant.

Take the interior value.

Try to coerce value into a unit.

Try to coerce value into a boolean.

Try to coerce value into a boolean.

Try to coerce value into a byte.

Try to coerce value into a character.

Try to coerce value into an integer.

Try to coerce value into a float.

Try to coerce value into a result.

Try to coerce value into a generator.

Try to coerce value into a stream.

Try to coerce value into a future.

Try to coerce value into an option.

Try to coerce value into a string.

Try to coerce value into bytes.

Try to coerce value into a vector.

Try to coerce value into a tuple.

Try to coerce value into an object.

Try to coerce value into a range.

Try to coerce value into a function pointer.

Try to coerce value into a format spec.

Try to coerce value into an iterator.

Try to coerce value into an opaque value.

Try to coerce value into a ref and an associated guard.

Safety

This coerces a strong guard to the value into its raw components.

It is up to the caller to ensure that the returned pointer does not outlive the returned guard, not the virtual machine the value belongs to.

Try to coerce value into a ref and an associated guard.

Safety

This coerces a strong guard to the value into its raw components.

It is up to the caller to ensure that the returned pointer does not outlive the returned guard, not the virtual machine the value belongs to.

Get the type hash for the current value.

Get the type information for the current 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

Returns the “default value” for a type. Read more

Deserialize implementation for value pointers.

Deserialize this value from the given Serde deserializer. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Creates a value from an iterator. Read more

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

Serialize implementation for value pointers.

Serialize this value into the given Serde serializer. Read more

Convert into a value.

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.