Skip to main content

RedactionEntry

Struct RedactionEntry 

Source
#[non_exhaustive]
pub struct RedactionEntry {
Show 16 fields pub source: String, pub recognizer_id: Option<String>, pub recognizer_version_id: Option<String>, pub class: PiiClass, pub action: Action, pub field_name: Option<String>, pub document_kind: DocumentKind, pub conflict_loser: bool, pub decided_by: ConflictTier, pub created_at: i64, pub session_id: Option<String>, pub validator_fail_reason: Option<ValidatorFailReason>, pub ambiguity_record: Option<AmbiguityRecord>, pub collision_family: Option<String>, pub collision_variant: Option<String>, pub fallback_triggered: Option<FallbackReason>,
}
Expand description

One row of redaction metadata emitted to a RedactionLogger.

Fields identify the PII class, action taken, session ID, source document kind, conflict-resolution metadata, and timestamp. Does not contain the original PII value, the token string, or any identifiable content beyond what a compliance audit requires.

RedactionEntry is #[non_exhaustive]; adopters must construct via the public constructor or destructure with a wildcard pattern.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§source: String

Detector or recognizer source identifier.

§recognizer_id: Option<String>

Stable semantic recognizer identifier, when available.

§recognizer_version_id: Option<String>

Versioned recognizer artifact/rule identifier, when available.

§class: PiiClass

PII class affected by the decision.

§action: Action

Policy action applied to the span.

§field_name: Option<String>

Optional structured field name.

§document_kind: DocumentKind

Source document kind.

§conflict_loser: bool

Whether this entry records a loser in conflict resolution.

§decided_by: ConflictTier

Conflict tier that decided the outcome.

§created_at: i64

Creation timestamp in epoch milliseconds.

§session_id: Option<String>

Optional session identifier.

§validator_fail_reason: Option<ValidatorFailReason>

Optional validator failure reason for a vetoed candidate.

§ambiguity_record: Option<AmbiguityRecord>

Optional ambiguity metadata for a family-level fallback.

§collision_family: Option<String>

Collision family that influenced this decision.

§collision_variant: Option<String>

Collision variant that influenced this decision.

§fallback_triggered: Option<FallbackReason>

Safety-net fallback reason, when fallback policy handled the row.

Implementations§

Source§

impl RedactionEntry

Source

pub fn new( source: impl Into<String>, class: PiiClass, action: Action, field_name: Option<String>, document_kind: DocumentKind, conflict_loser: bool, decided_by: ConflictTier, created_at: i64, session_id: Option<String>, ) -> Self

Builds a metadata-only redaction log entry.

Source

pub fn with_validator_fail_reason(self, reason: ValidatorFailReason) -> Self

Attaches a validator failure reason to this metadata row.

Source

pub fn with_ambiguity_record(self, record: AmbiguityRecord) -> Self

Attaches an ambiguity record to this metadata row.

Source

pub fn with_collision_metadata( self, family: Option<String>, variant: Option<String>, ) -> Self

Attaches collision-family metadata to this row.

Source

pub fn with_fallback_triggered(self, reason: FallbackReason) -> Self

Attaches safety-net fallback metadata to this row.

Source

pub fn with_recognizer_metadata( self, recognizer_id: Option<String>, recognizer_version_id: Option<String>, ) -> Self

Attaches recognizer lineage metadata to this row.

Trait Implementations§

Source§

impl Clone for RedactionEntry

Source§

fn clone(&self) -> RedactionEntry

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RedactionEntry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for RedactionEntry

Source§

fn eq(&self, other: &RedactionEntry) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for RedactionEntry

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for RedactionEntry

Source§

impl StructuralPartialEq for RedactionEntry

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.