pub enum ValuePtr {
None,
Bool(bool),
Char(char),
Integer(i64),
Float(f64),
String(Slot),
Array(Slot),
Object(Slot),
External(Slot),
Type(Hash),
Fn(Hash),
}Expand description
An entry on the stack.
Variants§
None
An empty value indicating nothing.
Bool(bool)
A boolean.
Char(char)
A character.
Integer(i64)
A number.
Float(f64)
A float.
String(Slot)
A String.
Array(Slot)
An array.
Object(Slot)
An object.
External(Slot)
An external value.
Type(Hash)
A type.
Fn(Hash)
A function pointer.
Implementations§
Source§impl ValuePtr
impl ValuePtr
Sourcepub fn into_string(self, vm: &Vm) -> Result<Slot, StackError>
pub fn into_string(self, vm: &Vm) -> Result<Slot, StackError>
Try to coerce value reference into an array.
Sourcepub fn into_array(self, vm: &Vm) -> Result<Slot, StackError>
pub fn into_array(self, vm: &Vm) -> Result<Slot, StackError>
Try to coerce value reference into an array.
Sourcepub fn into_object(self, vm: &Vm) -> Result<Slot, StackError>
pub fn into_object(self, vm: &Vm) -> Result<Slot, StackError>
Try to coerce value reference into an object.
Sourcepub fn into_external(self, vm: &Vm) -> Result<Slot, StackError>
pub fn into_external(self, vm: &Vm) -> Result<Slot, StackError>
Try to coerce value reference into an external.
Sourcepub fn value_type(&self, vm: &Vm) -> Result<ValueType, StackError>
pub fn value_type(&self, vm: &Vm) -> Result<ValueType, StackError>
Get the type information for the current value.
Sourcepub fn type_info(&self, vm: &Vm) -> Result<ValueTypeInfo, StackError>
pub fn type_info(&self, vm: &Vm) -> Result<ValueTypeInfo, StackError>
Get the type information for the current value.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ValuePtr
Deserialize implementation for value pointers.
impl<'de> Deserialize<'de> for ValuePtr
Deserialize implementation for value pointers.
Warning: This only works if a Vm is accessible through tls, like by
being set up with tls::inject_vm or tls::InjectVm.
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl FromValue for ValuePtr
impl FromValue for ValuePtr
Source§fn from_value(value: ValuePtr, _: &mut Vm) -> Result<Self, StackError>
fn from_value(value: ValuePtr, _: &mut Vm) -> Result<Self, StackError>
Source§impl Serialize for ValuePtr
Serialize implementation for value pointers.
impl Serialize for ValuePtr
Serialize implementation for value pointers.
Warning: This only works if a Vm is accessible through tls, like by
being set up with tls::inject_vm or tls::InjectVm.