pub trait AdapterBuilder: Sized {
type Config: Send + Sync + Debug + Clone;
type Adapter: ModelAdapter;
// Required methods
fn build(self, model_path: &Path) -> Result<Self::Adapter, OCRError>;
fn with_config(self, config: Self::Config) -> Self;
fn adapter_type(&self) -> &str;
}Expand description
Builder trait for creating model adapters.
This trait defines the interface for building adapters with specific configurations.
Required Associated Types§
Sourcetype Adapter: ModelAdapter
type Adapter: ModelAdapter
The adapter type that this builder creates
Required Methods§
Sourcefn with_config(self, config: Self::Config) -> Self
fn with_config(self, config: Self::Config) -> Self
Sourcefn adapter_type(&self) -> &str
fn adapter_type(&self) -> &str
Returns the adapter type identifier.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".