pub struct CompositeMonitor { /* private fields */ }Expand description
SecurityMonitor that fans every event out to a list of inner
monitors.
Useful when you want, for example, a LogMonitor for human-readable
alerts and a custom MetricsMonitor for dashboards from the same
vault. Inner monitors are called in registration order; one failing
monitor does not affect the others (monitor implementations should
not panic per the trait contract).
§Examples
use std::sync::Arc;
use key_vault::{CompositeMonitor, NoMonitor, SecurityMonitor};
let composite = CompositeMonitor::new(vec![
Arc::new(NoMonitor) as Arc<dyn SecurityMonitor>,
Arc::new(NoMonitor) as Arc<dyn SecurityMonitor>,
]);
assert_eq!(composite.len(), 2);Implementations§
Source§impl CompositeMonitor
impl CompositeMonitor
Trait Implementations§
Source§impl Clone for CompositeMonitor
impl Clone for CompositeMonitor
Source§fn clone(&self) -> CompositeMonitor
fn clone(&self) -> CompositeMonitor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CompositeMonitor
impl Debug for CompositeMonitor
Source§impl SecurityMonitor for CompositeMonitor
impl SecurityMonitor for CompositeMonitor
Source§fn on_decryption_failure(&self, ctx: &FailureContext)
fn on_decryption_failure(&self, ctx: &FailureContext)
Called when a decryption attempt fails.
Source§fn on_anomalous_access(&self, ctx: &AccessContext)
fn on_anomalous_access(&self, ctx: &AccessContext)
Called when an access pattern looks anomalous to the configured
detector.
Source§fn on_threshold_breach(&self, ctx: &ThresholdContext)
fn on_threshold_breach(&self, ctx: &ThresholdContext)
Called when a configured failure threshold is crossed.
Auto Trait Implementations§
impl Freeze for CompositeMonitor
impl !RefUnwindSafe for CompositeMonitor
impl Send for CompositeMonitor
impl Sync for CompositeMonitor
impl Unpin for CompositeMonitor
impl UnsafeUnpin for CompositeMonitor
impl !UnwindSafe for CompositeMonitor
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