pub struct Redactor { /* private fields */ }Expand description
Privacy helper that redacts keys, paths, errors, tags, and raw text.
Implementations§
Source§impl Redactor
impl Redactor
Sourcepub fn new(config: PrivacyConfig) -> Redactor
pub fn new(config: PrivacyConfig) -> Redactor
Creates a redactor with lowercase key lookup for configured redact keys.
Sourcepub fn redact_value(&self, value: &Value) -> Value
pub fn redact_value(&self, value: &Value) -> Value
Redacts a JSON value by configured keys, dotted paths, and text rules.
Sourcepub fn redact_event(&self, event: ObservationEvent) -> ObservationEvent
pub fn redact_event(&self, event: ObservationEvent) -> ObservationEvent
Redacts every event surface that can carry user or domain text.
Sourcepub fn redact_error(&self, error: ObservationError) -> ObservationError
pub fn redact_error(&self, error: ObservationError) -> ObservationError
Redacts the error message while preserving the error kind.
Sourcepub fn redact_text_to_string(&self, text: &str) -> String
pub fn redact_text_to_string(&self, text: &str) -> String
Converts text into a safe string summary for tags and errors.
Sourcepub fn redact_text(&self, text: &str) -> Value
pub fn redact_text(&self, text: &str) -> Value
Converts text into a structured safe summary with length and optional hash.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Redactor
impl RefUnwindSafe for Redactor
impl Send for Redactor
impl Sync for Redactor
impl Unpin for Redactor
impl UnsafeUnpin for Redactor
impl UnwindSafe for Redactor
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreCreates a shared type from an unshared type.