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 schema(&self) -> TaskSchema;
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 its input/output schema and can be executed with various model adapters.
Required Associated Types§
Required Methods§
Sourcefn schema(&self) -> TaskSchema
fn schema(&self) -> TaskSchema
Returns the schema defining inputs and outputs for this task.
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.