pub struct IterContext<'a> {
pub iter_name: &'a str,
pub index: IterIndex<'a>,
pub depth: usize,
}Expand description
Per-iteration context surfaced to hooks for steps running inside an
iter_array or
iter_map body.
Exposes the enclosing iteration’s name, the current index or key,
and the nesting depth (outermost iteration is 0). Hooks can use
the nesting depth for indentation and the index for filtering or
profiling per element.
Fields§
§iter_name: &'a strThe name of the enclosing iteration node.
index: IterIndex<'a>The current iteration’s index or key.
depth: usizeZero-based depth: 0 for the outermost iteration, 1 for one
level of nesting, and so on.
Trait Implementations§
Source§impl<'a> Clone for IterContext<'a>
impl<'a> Clone for IterContext<'a>
Source§fn clone(&self) -> IterContext<'a>
fn clone(&self) -> IterContext<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for IterContext<'a>
impl<'a> Debug for IterContext<'a>
Auto Trait Implementations§
impl<'a> Freeze for IterContext<'a>
impl<'a> RefUnwindSafe for IterContext<'a>
impl<'a> Send for IterContext<'a>
impl<'a> Sync for IterContext<'a>
impl<'a> Unpin for IterContext<'a>
impl<'a> UnsafeUnpin for IterContext<'a>
impl<'a> UnwindSafe for IterContext<'a>
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