pub struct HookManager { /* private fields */ }Implementations§
Source§impl HookManager
impl HookManager
pub fn new() -> Self
pub fn with_timeout(timeout_secs: u64) -> Self
pub fn register<H: Hook + 'static>(&mut self, hook: H)
pub fn register_arc(&mut self, hook: Arc<dyn Hook>)
pub fn unregister(&mut self, name: &str)
pub fn hook_names(&self) -> Vec<&str>
pub fn has_hook(&self, name: &str) -> bool
pub fn hooks_for_event(&self, event: HookEvent) -> Vec<&Arc<dyn Hook>>
pub async fn execute( &self, event: HookEvent, input: HookInput, hook_context: &HookContext, ) -> Result<HookOutput, Error>
pub async fn execute_with_handler<F>( &self, event: HookEvent, input: HookInput, hook_context: &HookContext, handler: F, ) -> Result<HookOutput, Error>
Trait Implementations§
Source§impl Clone for HookManager
impl Clone for HookManager
Source§fn clone(&self) -> HookManager
fn clone(&self) -> HookManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreCreates a shared type from an unshared type.