For the complete documentation index, see llms.txt.
aztec-nr - noir_aztec::protocol::utils::for_loop

Function for_i_only_in_

pub fn for_i_only_in_<Env>(
    min: u32,
    max: u32,
    MIN: u32,
    MAX: u32,
    f_within: fn[Env](u32),
    assert_min_lte_max: bool,
    assert_max_lte_MAX: bool,
)

Iterates between loop bounds and conditionally executes a function for min <= i < max, where:

  • min and max are dynamic loop bounds (known only at runtime).
  • MIN and MAX are static loop bounds (known at compile time).

MIN ------ <=
min ------

       f_within is executed for min <= i < max    

<= max ------ <= MAX ------

@param f_within: Lambda functions of the form |i| { my_array[i].assert_empty() } (for example) can be specified.