pub struct PiiEntity {
pub entity_type: EntityType,
pub span: Span,
pub text: String,
pub confidence: Confidence,
pub recognizer_id: String,
}Expand description
A detected PII entity within text.
§Examples
use cloakrs_core::{Confidence, EntityType, PiiEntity, Span};
let entity = PiiEntity {
entity_type: EntityType::Email,
span: Span::new(11, 27),
text: "user@example.com".to_string(),
confidence: Confidence::new(0.95).unwrap(),
recognizer_id: "email_regex_v1".to_string(),
};
assert_eq!(entity.span.len(), 16);Fields§
§entity_type: EntityTypeThe type of PII detected.
span: SpanByte offset range in the source text, using [start, end).
text: StringThe matched value.
confidence: ConfidenceConfidence score from 0.0 to 1.0.
recognizer_id: StringIdentifier of the recognizer that produced this finding.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PiiEntity
impl<'de> Deserialize<'de> for PiiEntity
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for PiiEntity
Auto Trait Implementations§
impl Freeze for PiiEntity
impl RefUnwindSafe for PiiEntity
impl Send for PiiEntity
impl Sync for PiiEntity
impl Unpin for PiiEntity
impl UnsafeUnpin for PiiEntity
impl UnwindSafe for PiiEntity
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