/// Fuzz for n iterations
/// Returns the index of the last fuzzed corpus item
///
/// If you use this fn in a restarting scenario to only run for `n` iterations,
/// before exiting, make sure you call `event_mgr.on_restart(&mut state)?;`.
/// This way, the state will be available in the next, respawned, iteration.
Fuzz for n iterations
Returns the index of the last fuzzed corpus item

If you use this fn in a restarting scenario to only run for `n` iterations,
before exiting, make sure you call `event_mgr.on_restart(&mut state)?;`.
This way, the state will be available in the next, respawned, iteration.
Fuzz for n iterations Returns the index of the last fuzzed corpus item If you use this fn in a restarting scenario to only run for ` n ` iterations before exiting make sure you call ` event_mgr . on_restart ( &mut state ) ? ; ` . This way the state will be available in the next respawned iteration .
fn fuzz_loop_for(
        &mut self,
        stages: &mut ST,
        executor: &mut E,
        state: &mut S,
        manager: &mut EM,
        iters: u64,
    ) -> Result<usize, Error> {
        if iters == 0 {
            return Err(Error::IllegalArgument(
                "Cannot fuzz for 0 iterations!".to_string(),
            ));
        }
        let mut ret = 0;
        let mut last = current_time();
        let monitor_timeout = STATS_TIMEOUT_DEFAULT;
        for _ in 0..iters {
            ret = self.fuzz_one(stages, executor, state, manager)?;
            last = manager.maybe_report_progress(state, last, monitor_timeout)?;
        }
        // If we would assume the fuzzer loop will always exit after this, we could do this here:
        // manager.on_restart(state)?;
        // But as the state may grow to a few megabytes,
        // for now we won' and the user has to do it (unless we find a way to do this on `Drop`).
        Ok(ret)
    }
fn fuzz_loop_for ( & mut self , stages : & mut ST , executor : & mut E , state : & mut S , manager : & mut EM , iters : u64 , ) -> Result < usize , Error > { if iters == 0 { return Err ( Error :: IllegalArgument ( " " . to_string ( ) , ) ) ; } let mut ret = 0 ; let mut last = current_time ( ) ; let monitor_timeout = STATS_TIMEOUT_DEFAULT ; for _ in 0 .. iters { ret = self . fuzz_one ( stages , executor , state , manager ) ? ; last = manager . maybe_report_progress ( state , last , monitor_timeout ) ? ; } // If we would assume the fuzzer loop will always exit after this, we could do this here: // manager.on_restart(state)?; // But as the state may grow to a few megabytes, // for now we won' and the user has to do it (unless we find a way to do this on `Drop`). Ok ( ret ) }
Fuzz for n iterations
Returns the index of the last fuzzed corpus item
Fuzz for n iterations Returns the index of the last fuzzed corpus item
&mut self
stages
&mut ST
executor
&mut E
state
&mut S
manager
&mut EM
iters
u64