pub struct PatternGuard { /* private fields */ }Expand description
Pattern-based guard using the PatternMatcher
Implementations§
Source§impl PatternGuard
impl PatternGuard
Sourcepub fn new(name: impl Into<String>, matcher: PatternMatcher) -> Self
pub fn new(name: impl Into<String>, matcher: PatternMatcher) -> Self
Create a new pattern guard
Sourcepub fn with_action(self, action: GuardAction) -> Self
pub fn with_action(self, action: GuardAction) -> Self
Set the action
Sourcepub fn with_severity_threshold(self, severity: Severity) -> Self
pub fn with_severity_threshold(self, severity: Severity) -> Self
Set the severity threshold
Sourcepub fn with_redact_pattern(self, pattern: impl Into<String>) -> Self
pub fn with_redact_pattern(self, pattern: impl Into<String>) -> Self
Set the redaction pattern (for sanitize action)
Trait Implementations§
Source§impl Guard for PatternGuard
impl Guard for PatternGuard
Source§fn check(&self, content: &str) -> GuardCheckResult
fn check(&self, content: &str) -> GuardCheckResult
Check content against this guard
Source§fn action(&self) -> GuardAction
fn action(&self) -> GuardAction
Get the action this guard takes on failure
Source§fn severity_threshold(&self) -> Severity
fn severity_threshold(&self) -> Severity
Get the minimum severity that triggers this guard
Auto Trait Implementations§
impl Freeze for PatternGuard
impl RefUnwindSafe for PatternGuard
impl Send for PatternGuard
impl Sync for PatternGuard
impl Unpin for PatternGuard
impl UnwindSafe for PatternGuard
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<G> InstrumentGuard for Gwhere
G: Guard,
impl<G> InstrumentGuard for Gwhere
G: Guard,
Source§fn instrumented(self) -> InstrumentedGuard<Self>
fn instrumented(self) -> InstrumentedGuard<Self>
Wrap this guard with metrics instrumentation
Source§fn instrumented_with(
self,
collector: Arc<GuardMetricsCollector>,
) -> InstrumentedGuard<Self>
fn instrumented_with( self, collector: Arc<GuardMetricsCollector>, ) -> InstrumentedGuard<Self>
Wrap this guard with a specific collector