Snapshot all registered entries. Used by the enforcement loop to iterate without holding the lock across dispatches.
(&self)
| 121 | /// Snapshot all registered entries. Used by the enforcement loop to |
| 122 | /// iterate without holding the lock across dispatches. |
| 123 | pub fn snapshot(&self) -> Vec<Entry> { |
| 124 | let r = self.inner.read().unwrap_or_else(|p| p.into_inner()); |
| 125 | r.values().cloned().collect() |
| 126 | } |
| 127 | |
| 128 | pub fn is_empty(&self) -> bool { |
| 129 | let r = self.inner.read().unwrap_or_else(|p| p.into_inner()); |