pub struct HookManager { /* private fields */ }Expand description
Hook manager for managing multiple hooks
Implementations§
Source§impl HookManager
impl HookManager
pub fn new() -> Self
pub fn add_hook(&mut self, hook: Box<dyn OptimizationHook>)
pub fn trigger_optimization_start( &mut self, config: &PluginConfig, constraints: &ParameterConstraints, ) -> Result<(), HookError>
pub fn trigger_iteration_start( &mut self, iteration: usize, history: &OptimizationHistory, ) -> Result<(), HookError>
pub fn trigger_evaluation( &mut self, parameters: &HashMap<String, Float>, objective_value: Float, iteration: usize, ) -> Result<(), HookError>
pub fn trigger_iteration_end( &mut self, iteration: usize, history: &OptimizationHistory, ) -> Result<(), HookError>
pub fn trigger_optimization_end( &mut self, history: &OptimizationHistory, reason: StopReason, ) -> Result<(), HookError>
pub fn trigger_error(&mut self, error: &dyn Error) -> Result<(), HookError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HookManager
impl !RefUnwindSafe for HookManager
impl Send for HookManager
impl Sync for HookManager
impl Unpin for HookManager
impl !UnwindSafe for HookManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more