pub struct HookManager { /* private fields */ }Expand description
Hook manager for managing and executing hooks
Implementations§
Source§impl HookManager
impl HookManager
Sourcepub fn register_hook(
&mut self,
hook: Box<dyn ExecutionHook>,
phases: Vec<HookPhase>,
)
pub fn register_hook( &mut self, hook: Box<dyn ExecutionHook>, phases: Vec<HookPhase>, )
Register a hook for specific phases
Sourcepub fn execute_hooks(
&mut self,
phase: HookPhase,
context: &mut ExecutionContext,
data: Option<&HookData>,
) -> SklResult<HookResult>
pub fn execute_hooks( &mut self, phase: HookPhase, context: &mut ExecutionContext, data: Option<&HookData>, ) -> SklResult<HookResult>
Execute hooks for a specific phase
Sourcepub fn create_context(
&self,
execution_id: String,
total_steps: usize,
) -> ExecutionContext
pub fn create_context( &self, execution_id: String, total_steps: usize, ) -> ExecutionContext
Create a new execution context
Sourcepub fn push_context(&mut self, context: ExecutionContext)
pub fn push_context(&mut self, context: ExecutionContext)
Push execution context onto stack
Sourcepub fn pop_context(&mut self) -> Option<ExecutionContext>
pub fn pop_context(&mut self) -> Option<ExecutionContext>
Pop execution context from stack
Sourcepub fn current_context(&self) -> Option<&ExecutionContext>
pub fn current_context(&self) -> Option<&ExecutionContext>
Get current execution context
Sourcepub fn current_context_mut(&mut self) -> Option<&mut ExecutionContext>
pub fn current_context_mut(&mut self) -> Option<&mut ExecutionContext>
Get mutable current execution context
Sourcepub fn update_global_metrics<F>(&self, updater: F)where
F: FnOnce(&mut PerformanceMetrics),
pub fn update_global_metrics<F>(&self, updater: F)where
F: FnOnce(&mut PerformanceMetrics),
Update global metrics
Sourcepub fn global_metrics(&self) -> PerformanceMetrics
pub fn global_metrics(&self) -> PerformanceMetrics
Get global metrics snapshot
Trait Implementations§
Source§impl Debug for HookManager
impl Debug for HookManager
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