Skip to main content

AlgorithmVariant

Trait AlgorithmVariant 

Source
pub trait AlgorithmVariant<T> {
    // Required methods
    fn name(&self) -> &str;
    fn execute(&self, input: &T) -> Result<T, AlgorithmError>;
    fn is_applicable(&self, input: &T) -> bool;
    fn estimated_cost(&self, input: &T) -> f64;
}
Expand description

Algorithm variant for dynamic selection

Required Methods§

Source

fn name(&self) -> &str

Source

fn execute(&self, input: &T) -> Result<T, AlgorithmError>

Source

fn is_applicable(&self, input: &T) -> bool

Source

fn estimated_cost(&self, input: &T) -> f64

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§