#[non_exhaustive]pub struct Candidate {
pub span: Range<usize>,
pub class: PiiClass,
pub recognizer_id: String,
pub score: f32,
pub priority: i32,
pub canonical_form: Option<String>,
pub token_family: String,
pub source: String,
pub decided_by: ConflictTier,
pub merged_sources: Vec<String>,
}Expand description
Candidate PII span emitted by a recognizer before final conflict resolution.
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.span: Range<usize>Byte span in the original input.
class: PiiClassPII class assigned to the span.
recognizer_id: StringRecognizer identifier.
score: f32Recognizer confidence score.
priority: i32Rule or recognizer priority.
canonical_form: Option<String>Optional canonical representation for validation/merge logic.
token_family: StringToken family used for output token shape.
source: StringCandidate source label.
decided_by: ConflictTierConflict tier that decided this candidate.
merged_sources: Vec<String>Sources merged into this candidate.
Implementations§
Source§impl Candidate
impl Candidate
Sourcepub fn new(
span: Range<usize>,
class: PiiClass,
recognizer_id: impl Into<String>,
score: f32,
priority: i32,
canonical_form: Option<String>,
token_family: impl Into<String>,
source: impl Into<String>,
decided_by: ConflictTier,
merged_sources: Vec<String>,
) -> Candidate
pub fn new( span: Range<usize>, class: PiiClass, recognizer_id: impl Into<String>, score: f32, priority: i32, canonical_form: Option<String>, token_family: impl Into<String>, source: impl Into<String>, decided_by: ConflictTier, merged_sources: Vec<String>, ) -> Candidate
Builds a recognizer candidate.
Trait Implementations§
impl StructuralPartialEq for Candidate
Auto Trait Implementations§
impl Freeze for Candidate
impl RefUnwindSafe for Candidate
impl Send for Candidate
impl Sync for Candidate
impl Unpin for Candidate
impl UnsafeUnpin for Candidate
impl UnwindSafe for Candidate
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