Crate optirustic_macros

Source

Attribute Macrosยง

as_algorithm
This macro adds the following private fields to the struct defining an algorithm: problem, number_of_individuals, population, generation,stopping_condition, number_of_function_evaluations, start_time, export_history and parallel.
as_algorithm_args
Register new fields on a struct that contains algorithm options. This macro adds:
impl_algorithm_trait_items
This macro adds common items when the Algorithm trait is implemented for a new algorithm struct. This adds the following items: Algorithm::name(), Algorithm::stopping_condition() Algorithm::start_time(), Algorithm::problem(), Algorithm::population(), Algorithm::generation(), Algorithm::number_of_function_evaluations() and Algorithm::export_history().
test_with_retries
An attribute macro to repeat a test n times until the test passes. The test passes if it does not panic at least once, it fails if it panics n times.