Skip to main content

ComponentLifecycle

Trait ComponentLifecycle 

Source
pub trait ComponentLifecycle: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn start(&self) -> LifecycleFuture<'_>;
    fn shutdown(&self) -> LifecycleFuture<'_>;
}
Expand description

Object-safe lifecycle contract used by the Saddle application assembler.

Implementations must be safe to start once and shut down once. Ordering and graceful-drain policy belong to saddle-runtime, not this contract.

Required Methods§

Source

fn name(&self) -> &'static str

Source

fn start(&self) -> LifecycleFuture<'_>

Source

fn shutdown(&self) -> LifecycleFuture<'_>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§