pub fn fork_map<M, Left, Right>(
model: M,
accum: &mut Vec<Left>,
fork_fn: impl Fn(M::Arg) -> (Left, Right),
) -> M::Mapped<Right>where
M: Parametric,Expand description
A low-level utility that maps a parametric structure while extracting a second set of values.
This function iterates through the model, applying fork_fn to each parameter.
The fork_fn returns a tuple (Left, Right).
- The
Leftvalue is collected into theaccumvector. - The
Rightvalue is used to construct the new, mapped model structure.
It is an efficient building block for extract_map_defaults because it pre-allocates
the accumulator Vec and fills it without intermediate allocations.