pub struct EventLog { /* private fields */ }Expand description
Thread-safe ring-buffer event log. Automatically evicts the oldest events when capacity is reached. All operations recover from mutex poisoning.
Implementations§
Source§impl EventLog
impl EventLog
Sourcepub fn new(max_capacity: usize) -> Self
pub fn new(max_capacity: usize) -> Self
Creates a new event log with the given maximum capacity.
use victauri_core::EventLog;
let log = EventLog::new(100);
assert!(log.is_empty());
assert_eq!(log.capacity(), 100);Sourcepub fn snapshot_range(&self, offset: usize, limit: usize) -> Vec<AppEvent>
pub fn snapshot_range(&self, offset: usize, limit: usize) -> Vec<AppEvent>
Returns a paginated slice of events starting at offset, up to limit items.
Sourcepub fn since(&self, timestamp: DateTime<Utc>) -> Vec<AppEvent>
pub fn since(&self, timestamp: DateTime<Utc>) -> Vec<AppEvent>
Returns all events with a timestamp at or after the given time.
Sourcepub fn ipc_calls(&self) -> Vec<IpcCall>
pub fn ipc_calls(&self) -> Vec<IpcCall>
Returns all IPC call events, filtering out non-IPC events.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EventLog
impl RefUnwindSafe for EventLog
impl Send for EventLog
impl Sync for EventLog
impl Unpin for EventLog
impl UnsafeUnpin for EventLog
impl UnwindSafe for EventLog
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more