Skip to main content

LifecycleHooks

Trait LifecycleHooks 

Source
pub trait LifecycleHooks: Send + Sync {
    // Required methods
    fn on_host_revoked(&self, host_id: &str) -> Result<()>;
    fn on_hat_purged<'a>(&'a self, hat_id: &'a str) -> Purge<'a>;
}
Expand description

Called by the kernel’s lifecycle operations once the kernel’s own part is done.

Required Methods§

Source

fn on_host_revoked(&self, host_id: &str) -> Result<()>

The host is revoked and its connection is gone (kernel spec §4.3): nothing it held will ever be reconciled. Must be idempotent: a repeated revoke calls it again.

Source

fn on_hat_purged<'a>(&'a self, hat_id: &'a str) -> Purge<'a>

The hat is frozen for its purge (kernel spec §5.5; plan 9c decision 10d): delete everything of it the module keeps, before the kernel deletes the hat’s row. Runs in transactions of its own. Must be idempotent: a purge that stopped is resumed by running it again. An error leaves the hat frozen, for a later purge to resume.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§