pub enum FieldRedaction<'a> {
Masked {
value: RedactedText<'a>,
sensitivity: Sensitivity,
},
PassedThrough {
value: &'a str,
reason: PassThroughReason,
},
}Expand description
Explains whether a field value was masked or intentionally passed through.
std::fmt::Debug remains available for inspecting the policy result
during debugging. Plain-text log sinks should consume
Self::escape_for_log instead of formatting this enum directly.
Variants§
Masked
The policy masked the value at the reported sensitivity.
Fields
§
value: RedactedText<'a>The typed masked value.
§
sensitivity: SensitivitySensitivity used to select the mask.
PassedThrough
The policy intentionally retained the original value.
Fields
§
reason: PassThroughReasonWhy the policy retained the value.
Implementations§
Source§impl<'a> FieldRedaction<'a>
impl<'a> FieldRedaction<'a>
Sourcepub const fn sensitivity(&self) -> Option<Sensitivity>
pub const fn sensitivity(&self) -> Option<Sensitivity>
Returns the masking sensitivity, or None for pass-through values.
Sourcepub const fn pass_through_reason(&self) -> Option<PassThroughReason>
pub const fn pass_through_reason(&self) -> Option<PassThroughReason>
Returns the pass-through reason, or None for masked values.
Sourcepub fn into_owned(self) -> String
pub fn into_owned(self) -> String
Converts the processed value into an owned string.
Sourcepub fn escape_for_log(self) -> LogSafeText<'a>
pub fn escape_for_log(self) -> LogSafeText<'a>
Escapes the processed value for a plain-text log boundary.
Trait Implementations§
Source§impl<'a> Clone for FieldRedaction<'a>
impl<'a> Clone for FieldRedaction<'a>
Source§fn clone(&self) -> FieldRedaction<'a>
fn clone(&self) -> FieldRedaction<'a>
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<'a> Debug for FieldRedaction<'a>
impl<'a> Debug for FieldRedaction<'a>
impl<'a> Eq for FieldRedaction<'a>
Source§impl<'a> PartialEq for FieldRedaction<'a>
impl<'a> PartialEq for FieldRedaction<'a>
impl<'a> StructuralPartialEq for FieldRedaction<'a>
Auto Trait Implementations§
impl<'a> Freeze for FieldRedaction<'a>
impl<'a> RefUnwindSafe for FieldRedaction<'a>
impl<'a> Send for FieldRedaction<'a>
impl<'a> Sync for FieldRedaction<'a>
impl<'a> Unpin for FieldRedaction<'a>
impl<'a> UnsafeUnpin for FieldRedaction<'a>
impl<'a> UnwindSafe for FieldRedaction<'a>
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