pub enum Value {
Show 28 variants
Byte(u8),
Int([u8; 7]),
Float(F56),
CodePoint(char),
CharCluster(u8, [u8; 6]),
CharClusterLong(Handle),
Symbol(Interned),
Keyword(Interned),
StringConst(Interned),
Special(Interned),
Builtin(u32),
True,
False,
Nil,
Undefined,
String(Handle),
Vector(Handle),
Map(Handle),
Bytes(Handle),
Pair(Handle),
List(Handle, u16),
Lambda(Handle),
Closure(Handle),
Continuation(Handle),
CallFrame(Handle),
Value(Handle),
Error(Handle),
Io(Handle),
}
Variants§
Byte(u8)
Int([u8; 7])
Float(F56)
CodePoint(char)
CharCluster(u8, [u8; 6])
CharClusterLong(Handle)
Symbol(Interned)
Keyword(Interned)
StringConst(Interned)
Special(Interned)
Builtin(u32)
True
False
Nil
Undefined
String(Handle)
Vector(Handle)
Map(Handle)
Bytes(Handle)
Pair(Handle)
List(Handle, u16)
Lambda(Handle)
Closure(Handle)
Continuation(Handle)
CallFrame(Handle)
Value(Handle)
Error(Handle)
Io(Handle)
Implementations§
Source§impl Value
impl Value
pub fn new() -> Self
pub fn unref<ENV>(self, vm: &GVm<ENV>) -> Value
pub fn get_symbol(&self) -> Option<Interned>
pub fn is_symbol(&self, sym: Interned) -> bool
pub fn is_indirect(&self) -> bool
pub fn is_nil(&self) -> bool
pub fn is_undef(&self) -> bool
pub fn is_true(&self) -> bool
pub fn is_truthy(&self) -> bool
pub fn is_false(&self) -> bool
pub fn is_falsey(&self) -> bool
pub fn is_int(&self) -> bool
pub fn is_number(&self) -> bool
pub fn is_float(&self) -> bool
pub fn not(&self) -> Value
pub fn get_int<ENV>(&self, vm: &GVm<ENV>) -> VMResult<i64>
pub fn get_float<ENV>(&self, _vm: &GVm<ENV>) -> VMResult<f64>
pub fn get_string<'vm, ENV>(&self, vm: &'vm GVm<ENV>) -> VMResult<&'vm str>
pub fn get_handle(&self) -> Option<Handle>
pub fn get_pair<ENV>(&self, vm: &GVm<ENV>) -> Option<(Value, Value)>
Sourcepub fn iter<'vm, ENV>(
&self,
vm: &'vm GVm<ENV>,
) -> Box<dyn Iterator<Item = Value> + 'vm>
pub fn iter<'vm, ENV>( &self, vm: &'vm GVm<ENV>, ) -> Box<dyn Iterator<Item = Value> + 'vm>
Returns an iterator over all values in the list, vector, pair. If the item is not one of the above it returns an empty iterator.
Sourcepub fn iter_all<'vm, ENV>(
&self,
vm: &'vm GVm<ENV>,
) -> Box<dyn Iterator<Item = Value> + 'vm>
pub fn iter_all<'vm, ENV>( &self, vm: &'vm GVm<ENV>, ) -> Box<dyn Iterator<Item = Value> + 'vm>
Returns an iterator over all values in the list, vector, pair. Returns an empty iterator if the value is nil. If the item is not one of the above it returns a once iter of the value.
Particularly useful if iterating over a Vec<Value>
that contains a heterogeneous
mix of List(s), Vector(s), Pair(s), and potentially other values, rather than
returning an empty list for any non-iterable thing, return a once iter so
the item is not missed.
pub fn display_value<ENV>(&self, vm: &GVm<ENV>) -> String
pub fn pretty_value<ENV>(&self, vm: &GVm<ENV>) -> String
Sourcepub fn value_type<ENV>(&self, vm: &GVm<ENV>) -> ValueType
pub fn value_type<ENV>(&self, vm: &GVm<ENV>) -> ValueType
pub fn display_type<ENV>(&self, vm: &GVm<ENV>) -> &'static str
pub fn is_proper_list<ENV>(&self, vm: &GVm<ENV>) -> bool
Trait Implementations§
impl BridgedType for &Value
impl BridgedType for &mut Value
impl BridgedType for Value
impl Copy for Value
impl Eq for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more