pub trait ModelProviderFactory: Send + Sync {
// Required methods
fn provider_name(&self) -> &str;
fn implementation(&self) -> ModelProviderImplementation;
fn validate(&self, definition: &ModelDefinition) -> Result<()>;
fn build(
&self,
definition: &ModelDefinition,
) -> Result<Arc<dyn ModelProvider>>;
}Expand description
A compiled, trusted provider factory registered explicitly by the host.
Required Methods§
Sourcefn provider_name(&self) -> &str
fn provider_name(&self) -> &str
Configuration name used by ModelDefinition::provider.
Sourcefn implementation(&self) -> ModelProviderImplementation
fn implementation(&self) -> ModelProviderImplementation
Stable, non-secret adapter identity and compatibility version.
Sourcefn validate(&self, definition: &ModelDefinition) -> Result<()>
fn validate(&self, definition: &ModelDefinition) -> Result<()>
Validate provider-specific configuration without side effects.
Sourcefn build(&self, definition: &ModelDefinition) -> Result<Arc<dyn ModelProvider>>
fn build(&self, definition: &ModelDefinition) -> Result<Arc<dyn ModelProvider>>
Construct the provider for runtime execution.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".