Skip to main content

PluginFactoryWrapper

Trait PluginFactoryWrapper 

Source
pub trait PluginFactoryWrapper:
    Debug
    + Send
    + Sync {
    // Required methods
    fn create_f32(
        &self,
        config: OptimizerConfig,
    ) -> Result<Box<dyn OptimizerPlugin<f32>>>;
    fn create_f64(
        &self,
        config: OptimizerConfig,
    ) -> Result<Box<dyn OptimizerPlugin<f64>>>;
    fn info(&self) -> PluginInfo;
    fn validate_config(&self, config: &OptimizerConfig) -> Result<()>;
    fn default_config(&self) -> OptimizerConfig;
    fn config_schema(&self) -> ConfigSchema;
    fn supports_type(&self, datatype: &DataType) -> bool;

    // Provided method
    fn capabilities(&self) -> PluginCapabilities { ... }
}
Expand description

Wrapper trait for type-erased plugin factories

Required Methods§

Source

fn create_f32( &self, config: OptimizerConfig, ) -> Result<Box<dyn OptimizerPlugin<f32>>>

Create optimizer with f32 precision

Source

fn create_f64( &self, config: OptimizerConfig, ) -> Result<Box<dyn OptimizerPlugin<f64>>>

Create optimizer with f64 precision

Source

fn info(&self) -> PluginInfo

Get factory information

Source

fn validate_config(&self, config: &OptimizerConfig) -> Result<()>

Validate configuration

Source

fn default_config(&self) -> OptimizerConfig

Get default configuration

Source

fn config_schema(&self) -> ConfigSchema

Get configuration schema

Source

fn supports_type(&self, datatype: &DataType) -> bool

Check if factory supports the given data type

Provided Methods§

Source

fn capabilities(&self) -> PluginCapabilities

Get the capabilities the produced optimizer declares. Backed by a default so existing PluginFactoryWrapper implementors outside this crate keep compiling; the default reports every capability absent (PluginCapabilities::default() is all-false), which is the safe direction to fail in for PluginQuery::required_capabilities filtering – an unimplemented override under-promises rather than over-promising what the plugin can do.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§