INNER CODE UNIT · Rust
find_all
autopilot-rs/autopilot-rs · src/bitmap.rs:353
fn find_all<'a>(
&self,
rect: Option<Rect>,
start_point: Option<Point>,
predicate: &'a dyn Fn(Point) -> bool,
matched: &'a mut dyn FnMut(Point),
) {
let rect = rect.unwrap_or_else(|| self.bounds());
let mut start_point = start_point.unwrap_or(self.bounds().origin);
loop {
if let Some(point) = self.find(Some(rect), Some(start_point), predicate) {
matched(point);
if let Some(next_point) = rect.iter_point(point) {
start_point = next_point;
continue;
}
}