pub struct AuditLog { /* private fields */ }Expand description
Audit log — append-only event recorder with query and subscription.
Implementations§
Source§impl AuditLog
impl AuditLog
Sourcepub fn new(channel_capacity: usize) -> AuditLog
pub fn new(channel_capacity: usize) -> AuditLog
Create a new audit log.
When channel_capacity > 0, subscribers receive events via a
broadcast channel.
Sourcepub fn log(&self, entry: AuditEntry)
pub fn log(&self, entry: AuditEntry)
Append a new entry. Trims oldest entries when max_entries is exceeded.
Sourcepub fn query(&self, filter: AuditFilter) -> Vec<AuditEntry>
pub fn query(&self, filter: AuditFilter) -> Vec<AuditEntry>
Query entries matching the filter.
Sourcepub fn entries(&self) -> Vec<AuditEntry>
pub fn entries(&self) -> Vec<AuditEntry>
Return all entries in chronological order.
Sourcepub fn subscribe(&self) -> Receiver<AuditEntry>
pub fn subscribe(&self) -> Receiver<AuditEntry>
Subscribe to new audit entries.
Sourcepub fn total_appended(&self) -> u64
pub fn total_appended(&self) -> u64
Return the total number of entries ever appended.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AuditLog
impl !RefUnwindSafe for AuditLog
impl !UnwindSafe for AuditLog
impl Send for AuditLog
impl Sync for AuditLog
impl Unpin for AuditLog
impl UnsafeUnpin for AuditLog
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