Enum rune::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<Vm>>),
Generator(Shared<Generator<Vm>>),
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(bool)
Tuple Fields
0: bool
A boolean.
Byte(u8)
Tuple Fields
0: u8
A single byte.
Char(char)
Tuple Fields
0: char
A character.
Integer(i64)
Tuple Fields
0: i64
A number.
Float(f64)
Tuple Fields
0: f64
A float.
Type(Hash)
Tuple Fields
0: Hash
A type hash. Describes a type in the virtual machine.
StaticString(Arc<StaticString>)
Tuple Fields
0: Arc<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.
String(Shared<String>)
A UTF-8 string.
Bytes(Shared<Bytes>)
A byte string.
Vec(Shared<Vec>)
A vector containing any values.
Tuple(Shared<Tuple>)
A tuple.
Object(Shared<Object>)
An object.
Range(Shared<Range>)
A range.
Future(Shared<Future>)
A stored future.
Stream(Shared<Stream<Vm>>)
A Stream.
Generator(Shared<Generator<Vm>>)
A stored generator.
GeneratorState(Shared<GeneratorState>)
Tuple Fields
0: Shared<GeneratorState>
Generator state.
Option(Shared<Option<Value>>)
An empty value indicating nothing.
Result(Shared<Result<Value, Value>>)
A stored result in a slot.
UnitStruct(Shared<UnitStruct>)
Tuple Fields
0: Shared<UnitStruct>
An struct with a well-defined type.
TupleStruct(Shared<TupleStruct>)
Tuple Fields
0: Shared<TupleStruct>
A tuple with a well-defined type.
Struct(Shared<Struct>)
An struct with a well-defined type.
Variant(Shared<Variant>)
The variant of an enum.
Function(Shared<Function>)
A stored function pointer.
Format(Box<Format>)
A value being formatted.
Iterator(Shared<Iterator>)
An iterator.
Any(Shared<AnyObj>)
An opaque value that can be downcasted.
Implementations
Format the value using the Protocol::STRING_DISPLAY protocol.
Requires a work buffer buf
which will be used in case the value
provided requires out-of-line formatting. This must be cleared between
calls and can be re-used.
You must use Vm::with to specify which virtual machine this function is called inside.
Panics
This function will panic if called outside of a virtual machine.
Debug format the value using the Protocol::STRING_DEBUG protocol.
You must use Vm::with to specify which virtual machine this function is called inside.
Panics
This function will panic if called outside of a virtual machine.
Convert value into an iterator using the Protocol::INTO_ITER protocol.
You must use Vm::with to specify which virtual machine this function is called inside.
Panics
This function will panic if called outside of a virtual machine.
Coerce into future, or convert into a future using the Protocol::INTO_FUTURE protocol.
You must use Vm::with to specify which virtual machine this function is called inside.
Panics
This function will panic if called outside of a virtual machine.
Coerce into a shared future, or convert into a future using the Protocol::INTO_FUTURE protocol.
You must use Vm::with to specify which virtual machine this function is called inside.
Panics
This function will panic if called outside of a virtual machine.
Construct an empty.
Construct an empty variant.
Construct a tuple variant.
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 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.
Trait Implementations
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.
Creates a value from an iterator. Read more
Try to convert to the given type, from the given value.
Serialize implementation for value pointers.
Auto Trait Implementations
impl !RefUnwindSafe for Value
impl !UnwindSafe for Value
Blanket Implementations
Mutably borrows from an owned value. Read more