pub enum ContextFrame {
Indexed {
data: Value,
index: usize,
},
Keyed {
data: Value,
index: usize,
key: String,
},
Reduce {
current: Value,
accumulator: Value,
},
Data(Value),
}Expand description
A single frame in the context stack, optimized as an enum to minimize size.
Field usage analysis shows mutually exclusive patterns:
- 59% of frames use only data + index (array iteration)
- 18% use data + index + key (object iteration)
- 9% use reduce_current + reduce_accumulator (reduce operations)
- 14% use only data (error context, etc.)
Variants§
Indexed
Array iteration frame — most common (data + index)
Keyed
Object iteration frame (data + index + key)
Reduce
Reduce operation frame (current + accumulator)
Data(Value)
Simple data-only frame
Implementations§
Source§impl ContextFrame
impl ContextFrame
Sourcepub fn get_reduce_current(&self) -> Option<&Value>
pub fn get_reduce_current(&self) -> Option<&Value>
Get the reduce “current” value if this is a reduce frame
Sourcepub fn get_reduce_accumulator(&self) -> Option<&Value>
pub fn get_reduce_accumulator(&self) -> Option<&Value>
Get the reduce “accumulator” value if this is a reduce frame
Auto Trait Implementations§
impl Freeze for ContextFrame
impl RefUnwindSafe for ContextFrame
impl Send for ContextFrame
impl Sync for ContextFrame
impl Unpin for ContextFrame
impl UnsafeUnpin for ContextFrame
impl UnwindSafe for ContextFrame
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