pub struct LifecycleHookRegistry { /* private fields */ }Expand description
Lifecycle hook registry
Manages all registered lifecycle hooks and provides methods to invoke them.
Implementations§
Source§impl LifecycleHookRegistry
impl LifecycleHookRegistry
Sourcepub async fn register_hook(&self, hook: Arc<dyn LifecycleHook>)
pub async fn register_hook(&self, hook: Arc<dyn LifecycleHook>)
Register a lifecycle hook
Sourcepub async fn invoke_before_request(&self, ctx: &RequestContext)
pub async fn invoke_before_request(&self, ctx: &RequestContext)
Invoke all registered before_request hooks
Sourcepub async fn invoke_after_response(&self, ctx: &ResponseContext)
pub async fn invoke_after_response(&self, ctx: &ResponseContext)
Invoke all registered after_response hooks
Sourcepub async fn invoke_mock_created(&self, event: &MockLifecycleEvent)
pub async fn invoke_mock_created(&self, event: &MockLifecycleEvent)
Invoke all registered on_mock_created hooks
Sourcepub async fn invoke_mock_updated(&self, event: &MockLifecycleEvent)
pub async fn invoke_mock_updated(&self, event: &MockLifecycleEvent)
Invoke all registered on_mock_updated hooks
Sourcepub async fn invoke_mock_deleted(&self, event: &MockLifecycleEvent)
pub async fn invoke_mock_deleted(&self, event: &MockLifecycleEvent)
Invoke all registered on_mock_deleted hooks
Sourcepub async fn invoke_mock_state_changed(&self, event: &MockLifecycleEvent)
pub async fn invoke_mock_state_changed(&self, event: &MockLifecycleEvent)
Invoke all registered on_mock_state_changed hooks
Sourcepub async fn invoke_startup(&self, event: &ServerLifecycleEvent)
pub async fn invoke_startup(&self, event: &ServerLifecycleEvent)
Invoke all registered on_startup hooks
Sourcepub async fn invoke_shutdown(&self, event: &ServerLifecycleEvent)
pub async fn invoke_shutdown(&self, event: &ServerLifecycleEvent)
Invoke all registered on_shutdown hooks
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LifecycleHookRegistry
impl !RefUnwindSafe for LifecycleHookRegistry
impl Send for LifecycleHookRegistry
impl Sync for LifecycleHookRegistry
impl Unpin for LifecycleHookRegistry
impl !UnwindSafe for LifecycleHookRegistry
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> 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 more