MCPcopy Create free account
hub / github.com/encounter/objdiff / iter_finished

Method iter_finished

objdiff-core/src/jobs/mod.rs:70–83  ·  view source on GitHub ↗

Iterates over all finished jobs, returning the job state and the result.

(
        &mut self,
    )

Source from the content-addressed store, hash-verified

68
69 /// Iterates over all finished jobs, returning the job state and the result.
70 pub fn iter_finished(
71 &mut self,
72 ) -> impl Iterator<Item = (&mut JobState, std::thread::Result<JobResult>)> + '_ {
73 self.jobs.iter_mut().filter_map(|job| {
74 if let Some(handle) = &job.handle {
75 if !handle.is_finished() {
76 return None;
77 }
78 let result = job.handle.take().unwrap().join();
79 return Some((job, result));
80 }
81 None
82 })
83 }
84
85 /// Clears all finished jobs.
86 pub fn clear_finished(&mut self) {

Callers 1

collect_resultsMethod · 0.80

Calls 1

iter_mutMethod · 0.80

Tested by

no test coverage detected