Skip to main content

shadow

Function shadow 

Source
pub(super) fn shadow<A, B, K, V>(
    main: A,
    shadow: B,
) -> ShadowIter<A::IntoIter, B::IntoIter> 
where K: Ord, A: IntoIterator<Item = (K, V)>, B: IntoIterator<Item = (K, V)>,
Expand description

Returns an iterator combining two other iterators (sorted by K).

If K is found in the shadow iterator (B), the element will be yielded from B, else from A.

This allows computing environment variables without having to clone and mutate the entire environment variables struct (see DerivationBuilder::hash_derivation_modulo).