pub enum ScalarValue {
Int(i64),
Bool(bool),
Float(f64),
Char(char),
Byte(u8),
}Expand description
One scalar payload read out of a debug slot, decoded under the slot’s
DebugSlotKind.
The point of the type is what it does not have: no pointer, no GcRef,
no descriptor. A consumer holding one of these cannot reach the heap through
it, which is why DebugValue is safe to hand to the crash-snapshot
walker, the renderer and the collector’s post-sweep scan alike.
Variants§
Trait Implementations§
Source§impl Clone for ScalarValue
impl Clone for ScalarValue
Source§fn clone(&self) -> ScalarValue
fn clone(&self) -> ScalarValue
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ScalarValue
Source§impl Debug for ScalarValue
impl Debug for ScalarValue
Source§impl Display for ScalarValue
Render a payload the way the object it came out of would have rendered.
impl Display for ScalarValue
Render a payload the way the object it came out of would have rendered.
The text must match, and that is the requirement rather than a nicety:
ADR-120 part 2 exists so a user cannot tell which temps the optimizer kept a
box for, and a Float that printed 3 here and 3.0 through
crate::scalars::FLOAT’s format would give the answer away. So this lives
beside those callbacks — write_float is literally the one FLOAT.format
calls (ADR-083’s .0 rule) — rather than in the debugger’s renderer, which
is the crate that would have had to guess.