pub struct LifecycleRunner { /* private fields */ }Expand description
Ordered lifecycle hook runner.
Implementations§
Source§impl LifecycleRunner
impl LifecycleRunner
Sourcepub fn new() -> LifecycleRunner
pub fn new() -> LifecycleRunner
Creates an empty lifecycle runner.
Sourcepub fn hook<H>(self, hook: H) -> LifecycleRunnerwhere
H: LifecycleHook,
pub fn hook<H>(self, hook: H) -> LifecycleRunnerwhere
H: LifecycleHook,
Registers a lifecycle hook.
Sourcepub async fn startup(&self) -> Result<(), NidusError>
pub async fn startup(&self) -> Result<(), NidusError>
Runs startup hooks in registration order.
Sourcepub async fn shutdown(&self) -> Result<(), NidusError>
pub async fn shutdown(&self) -> Result<(), NidusError>
Runs shutdown hooks in reverse registration order.
Every hook is attempted even when an earlier hook fails. The first failure in shutdown order is returned after the remaining hooks run.
Trait Implementations§
Source§impl Default for LifecycleRunner
impl Default for LifecycleRunner
Source§fn default() -> LifecycleRunner
fn default() -> LifecycleRunner
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for LifecycleRunner
impl !UnwindSafe for LifecycleRunner
impl Freeze for LifecycleRunner
impl Send for LifecycleRunner
impl Sync for LifecycleRunner
impl Unpin for LifecycleRunner
impl UnsafeUnpin for LifecycleRunner
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