Skip to main content

Detector

Trait Detector 

Source
pub trait Detector: Send + Sync {
    // Required method
    fn detect(&self, input: &str) -> Vec<Detection>;

    // Provided method
    fn try_detect(
        &self,
        input: &str,
    ) -> Result<Vec<Detection>, RecognizerRuntimeError> { ... }
}
Expand description

Shared detector contract for text-only PII detection.

Required Methods§

Source

fn detect(&self, input: &str) -> Vec<Detection>

Detect PII spans in the supplied input string.

Provided Methods§

Source

fn try_detect( &self, input: &str, ) -> Result<Vec<Detection>, RecognizerRuntimeError>

Fallible detection entrypoint for detectors backed by runtime systems.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§