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§
Provided Methods§
Sourcefn try_detect(
&self,
input: &str,
) -> Result<Vec<Detection>, RecognizerRuntimeError>
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".