(&self, predicate: P) -> Option<&T> where P: Fn(&T) -> bool { if self.pending.as_ref().map(|r| predicate(r)).unwrap_or(false) { self.pending.as_ref() } else { self.in_use.iter().find(|r| predicate(r)) } } /// Returns `Some` item which is the first that `f` returns `true` with a reference to it /// as a parameter or `None` if no such item exists in the queue. pub fn take_used_if
(&mut self, predicate: P) -> Option (&mut self, predicate: P) -> Option