Drain all events for inspection.
(&self)
| 103 | |
| 104 | /// Drain all events for inspection. |
| 105 | pub fn drain(&self) -> Vec<AuditEvent> { |
| 106 | let mut guard = self.events.lock().expect("audit lock poisoned"); |
| 107 | std::mem::take(&mut *guard) |
| 108 | } |
| 109 | |
| 110 | /// Return a snapshot of all events without draining. |
| 111 | pub fn snapshot(&self) -> Vec<AuditEvent> { |