Skip to main content

LifecycleHandle

Trait LifecycleHandle 

Source
pub trait LifecycleHandle: Send + Sync {
    // Required methods
    fn list(
        &self,
    ) -> impl Future<Output = Result<Vec<ResourceView>, LifecycleHandleError>> + Send;
    fn get(
        &self,
        name: &str,
    ) -> impl Future<Output = Result<ResourceView, LifecycleHandleError>> + Send;
    fn restart(
        &self,
        name: &str,
    ) -> impl Future<Output = Result<(), LifecycleHandleError>> + Send;
    fn logs(
        &self,
        name: &str,
        follow: bool,
    ) -> impl Future<Output = Result<LogChunkStream, LifecycleHandleError>> + Send;
    fn subscribe_events(&self) -> Receiver<LifecycleEvent>;
}
Expand description

Control-plane facing view of a running stack.

Implementations expose just enough to drive a dashboard, REST API and CLI subcommands without leaking any backend type.

Required Methods§

Source

fn list( &self, ) -> impl Future<Output = Result<Vec<ResourceView>, LifecycleHandleError>> + Send

List every resource managed by this stack with its current view.

Source

fn get( &self, name: &str, ) -> impl Future<Output = Result<ResourceView, LifecycleHandleError>> + Send

Look up a single resource by name.

Source

fn restart( &self, name: &str, ) -> impl Future<Output = Result<(), LifecycleHandleError>> + Send

Restart a single resource by name.

Source

fn logs( &self, name: &str, follow: bool, ) -> impl Future<Output = Result<LogChunkStream, LifecycleHandleError>> + Send

Stream logs for a single resource. When follow is true the stream stays open and emits new chunks as they arrive.

Source

fn subscribe_events(&self) -> Receiver<LifecycleEvent>

Open a fresh subscription on the lifecycle event broadcast. Implementations return a broadcast::Receiver so multiple consumers (REST handlers, WebSocket sessions, CLI followers) can read independently.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§