pub trait Task:
Send
+ Sync
+ Debug {
type Config: Send + Sync + Debug + Clone;
type Input: Send + Sync + Debug;
type Output: Send + Sync + Debug;
// Required methods
fn task_type(&self) -> TaskType;
fn validate_input(&self, input: &Self::Input) -> Result<(), OCRError>;
fn validate_output(&self, output: &Self::Output) -> Result<(), OCRError>;
fn empty_output(&self) -> Self::Output;
// Provided method
fn description(&self) -> String { ... }
}Expand description
Core trait for OCR tasks.
Tasks represent distinct operations in the OCR pipeline (detection, recognition, etc.). Each task defines typed inputs and outputs and can be executed with model adapters.
Required Associated Types§
Required Methods§
Sourcefn empty_output(&self) -> Self::Output
fn empty_output(&self) -> Self::Output
Returns an empty output instance for when no valid results are produced.
Provided Methods§
Sourcefn description(&self) -> String
fn description(&self) -> String
Returns a human-readable description of this task.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".