pub struct HookManager { /* private fields */ }Expand description
Hook manager for registering and executing performance hooks
Implementations§
Source§impl HookManager
impl HookManager
Sourcepub fn register_hook(
&self,
hook: Arc<dyn PerformanceHook>,
) -> Result<(), HookError>
pub fn register_hook( &self, hook: Arc<dyn PerformanceHook>, ) -> Result<(), HookError>
Register a performance hook
Sourcepub fn unregister_hook(&self, name: &str) -> Result<(), HookError>
pub fn unregister_hook(&self, name: &str) -> Result<(), HookError>
Unregister a performance hook
Sourcepub fn fire_event(&self, event: PerformanceEvent)
pub fn fire_event(&self, event: PerformanceEvent)
Fire a performance event
Sourcepub fn set_enabled(&self, enabled: bool)
pub fn set_enabled(&self, enabled: bool)
Enable or disable performance monitoring
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if performance monitoring is enabled
Sourcepub fn get_events(&self) -> Vec<PerformanceEvent>
pub fn get_events(&self) -> Vec<PerformanceEvent>
Get the event buffer
Sourcepub fn clear_events(&self)
pub fn clear_events(&self)
Clear the event buffer
Sourcepub fn get_hook_stats(&self) -> HookStats
pub fn get_hook_stats(&self) -> HookStats
Get statistics about registered hooks
Sourcepub fn set_max_buffer_size(&mut self, size: usize)
pub fn set_max_buffer_size(&mut self, size: usize)
Set maximum buffer size
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 UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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