pub struct AuditEngine { /* private fields */ }Expand description
Structured, queryable audit trail engine.
Implementations§
Source§impl AuditEngine
impl AuditEngine
pub fn new() -> Self
Sourcepub fn record(
&mut self,
execution_id: &str,
workflow_id: &str,
step_id: Option<&str>,
event_type: AuditEventType,
actor: &str,
resource: Option<&str>,
input: Option<Value>,
output: Option<Value>,
outcome: AuditOutcome,
) -> String
pub fn record( &mut self, execution_id: &str, workflow_id: &str, step_id: Option<&str>, event_type: AuditEventType, actor: &str, resource: Option<&str>, input: Option<Value>, output: Option<Value>, outcome: AuditOutcome, ) -> String
Record an audit event.
Sourcepub fn query(&self, q: &AuditQuery) -> Vec<&AuditEvent>
pub fn query(&self, q: &AuditQuery) -> Vec<&AuditEvent>
Query the audit trail.
Sourcepub fn timeline(
&self,
execution_id: Option<&str>,
limit: usize,
) -> Vec<&AuditEvent>
pub fn timeline( &self, execution_id: Option<&str>, limit: usize, ) -> Vec<&AuditEvent>
Get chronological timeline.
Sourcepub fn impact_analysis(&self, resource: &str) -> AuditImpact
pub fn impact_analysis(&self, resource: &str) -> AuditImpact
Find all workflows that touched a resource.
Sourcepub fn export(&self, query: &AuditQuery) -> WorkflowResult<String>
pub fn export(&self, query: &AuditQuery) -> WorkflowResult<String>
Export audit trail as JSON.
Sourcepub fn set_retention(&mut self, retention: AuditRetention)
pub fn set_retention(&mut self, retention: AuditRetention)
Set retention policy.
Sourcepub fn get_retention(&self) -> &AuditRetention
pub fn get_retention(&self) -> &AuditRetention
Get retention policy.
Sourcepub fn event_count(&self) -> usize
pub fn event_count(&self) -> usize
Total event count.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AuditEngine
impl RefUnwindSafe for AuditEngine
impl Send for AuditEngine
impl Sync for AuditEngine
impl Unpin for AuditEngine
impl UnsafeUnpin for AuditEngine
impl UnwindSafe for AuditEngine
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