pub trait SamplerPlugin: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn version(&self) -> &str;
fn initialize(
&mut self,
config: &HashMap<String, String>,
) -> Result<(), String>;
fn create_sampler(&self) -> Box<dyn Sampler>;
fn default_config(&self) -> HashMap<String, String>;
fn validate_config(
&self,
config: &HashMap<String, String>,
) -> Result<(), String>;
}Expand description
Plugin trait for custom samplers
Required Methods§
Sourcefn initialize(&mut self, config: &HashMap<String, String>) -> Result<(), String>
fn initialize(&mut self, config: &HashMap<String, String>) -> Result<(), String>
Initialize plugin
Sourcefn create_sampler(&self) -> Box<dyn Sampler>
fn create_sampler(&self) -> Box<dyn Sampler>
Create sampler instance
Sourcefn default_config(&self) -> HashMap<String, String>
fn default_config(&self) -> HashMap<String, String>
Get default configuration