pub enum Value {
Show 13 variants
Integer(i64),
Boolean(bool),
String(String),
Array(Vec<GcRef>),
Hash(HashMap<HashKey, GcRef>),
Null,
Error(String),
CompiledFunction(CompiledFunction),
Closure(GcClosure),
Builtin(BuiltinId),
Class(GcClass),
Instance(GcInstance),
BoundMethod(GcBoundMethod),
}Expand description
Runtime value stored in the GC heap. Mirrors object::Object but uses GcRef edges.
Variants§
Integer(i64)
Boolean(bool)
String(String)
Array(Vec<GcRef>)
Hash(HashMap<HashKey, GcRef>)
Null
Error(String)
CompiledFunction(CompiledFunction)
Closure(GcClosure)
Builtin(BuiltinId)
Class(GcClass)
Instance(GcInstance)
BoundMethod(GcBoundMethod)
Implementations§
Source§impl Value
impl Value
pub fn kind(&self) -> ValueKind
Sourcepub fn visit_edges(&self, visit: impl FnMut(EdgeRelation, GcRef))
pub fn visit_edges(&self, visit: impl FnMut(EdgeRelation, GcRef))
Visit heap edges with typed structural relations for diagnostics.
Hash keys, class methods, and instance fields are visited in stable
sorted order so reports stay deterministic. The collector’s trace
path remains allocation-free and visits only edge targets.
pub fn trace(&self, visit: &mut dyn FnMut(GcRef))
pub fn with_owned_edges(self, heap: &mut GcHeap) -> Self
pub fn edge_refs(&self) -> Vec<GcRef>
Trait Implementations§
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 UnsafeUnpin 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