pub struct RotatingAuditor { /* private fields */ }Expand description
Enhanced auditor with rotation policy and audit rules.
Built on top of SqlAuditor, it adds:
- Log rotation (automatic cleanup of old logs by size or age)
- Audit rules (allow/deny list filtering)
Implementations§
Source§impl RotatingAuditor
impl RotatingAuditor
pub fn new(policy: RotationPolicy, rules: AuditRules) -> Self
Sourcepub fn with_max_entries(max_entries: usize) -> Self
pub fn with_max_entries(max_entries: usize) -> Self
Create an auditor that rotates only by size, with no rule filtering
Sourcepub fn with_max_age(max_age_ms: i64) -> Self
pub fn with_max_age(max_age_ms: i64) -> Self
Create an auditor that rotates only by age, with no rule filtering
Sourcepub fn log(&self, ctx: &SqlAuditContext) -> bool
pub fn log(&self, ctx: &SqlAuditContext) -> bool
Record an audit log, automatically applying rule filtering and rotation policy
Sourcepub fn get_logs(&self) -> Vec<SqlAuditContext>
pub fn get_logs(&self) -> Vec<SqlAuditContext>
Return a snapshot of the current logs
Sourcepub fn rotation_count(&self) -> usize
pub fn rotation_count(&self) -> usize
Return the number of rotations performed
Auto Trait Implementations§
impl !Freeze for RotatingAuditor
impl RefUnwindSafe for RotatingAuditor
impl Send for RotatingAuditor
impl Sync for RotatingAuditor
impl Unpin for RotatingAuditor
impl UnsafeUnpin for RotatingAuditor
impl UnwindSafe for RotatingAuditor
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