pub trait PredictorBuilder: Sized {
type Config;
type Predictor;
// Required methods
fn build_typed(self, model_path: &Path) -> OcrResult<Self::Predictor>;
fn predictor_type(&self) -> &str;
fn with_config(self, config: Self::Config) -> Self;
// Provided method
fn build(self, model_path: &Path) -> OcrResult<Self::Predictor> { ... }
}Expand description
Trait for building predictors.
This trait defines the interface for building predictors with specific configurations.
Required Associated Types§
Required Methods§
Sourcefn build_typed(self, model_path: &Path) -> OcrResult<Self::Predictor>
fn build_typed(self, model_path: &Path) -> OcrResult<Self::Predictor>
Sourcefn predictor_type(&self) -> &str
fn predictor_type(&self) -> &str
Sourcefn with_config(self, config: Self::Config) -> Self
fn with_config(self, config: Self::Config) -> Self
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.