pub struct ErrorSanitizer { /* private fields */ }
Expand description
Main error sanitization engine
Implementations§
Source§impl ErrorSanitizer
impl ErrorSanitizer
Sourcepub fn with_config(config: SanitizerConfig) -> Self
pub fn with_config(config: SanitizerConfig) -> Self
Create a new error sanitizer with custom configuration
Sourcepub fn add_redaction_rule(&mut self, rule: RedactionRule)
pub fn add_redaction_rule(&mut self, rule: RedactionRule)
Add a custom redaction rule
Sourcepub fn sanitize<E>(&mut self, error: E, context: ErrorContext) -> SanitizedError
pub fn sanitize<E>(&mut self, error: E, context: ErrorContext) -> SanitizedError
Sanitize an error message based on context and mode
Sourcepub fn get_error_details(&self, correlation_id: &str) -> Option<&String>
pub fn get_error_details(&self, correlation_id: &str) -> Option<&String>
Retrieve stored error details by correlation ID (for debugging)
Sourcepub fn clear_error_store(&mut self)
pub fn clear_error_store(&mut self)
Clear stored error details (for memory management)
Sourcepub fn get_statistics(&self) -> SanitizerStatistics
pub fn get_statistics(&self) -> SanitizerStatistics
Get statistics about sanitization
Source§impl ErrorSanitizer
Convenience functions for common error types
impl ErrorSanitizer
Convenience functions for common error types
Sourcepub fn sanitize_io_error<E>(
&mut self,
error: E,
context: ErrorContext,
) -> SanitizedError
pub fn sanitize_io_error<E>( &mut self, error: E, context: ErrorContext, ) -> SanitizedError
Sanitize an I/O error
Sourcepub fn sanitize_parse_error<E>(&mut self, error: E) -> SanitizedError
pub fn sanitize_parse_error<E>(&mut self, error: E) -> SanitizedError
Sanitize a parsing error
Sourcepub fn sanitize_build_error<E>(&mut self, error: E) -> SanitizedError
pub fn sanitize_build_error<E>(&mut self, error: E) -> SanitizedError
Sanitize a build error
Sourcepub fn sanitize_security_error<E>(&mut self, error: E) -> SanitizedError
pub fn sanitize_security_error<E>(&mut self, error: E) -> SanitizedError
Sanitize a security error
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ErrorSanitizer
impl RefUnwindSafe for ErrorSanitizer
impl Send for ErrorSanitizer
impl Sync for ErrorSanitizer
impl Unpin for ErrorSanitizer
impl UnwindSafe for ErrorSanitizer
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more