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§
Sourcefn list(
&self,
) -> impl Future<Output = Result<Vec<ResourceView>, LifecycleHandleError>> + Send
fn list( &self, ) -> impl Future<Output = Result<Vec<ResourceView>, LifecycleHandleError>> + Send
List every resource managed by this stack with its current view.
Sourcefn get(
&self,
name: &str,
) -> impl Future<Output = Result<ResourceView, LifecycleHandleError>> + Send
fn get( &self, name: &str, ) -> impl Future<Output = Result<ResourceView, LifecycleHandleError>> + Send
Look up a single resource by name.
Sourcefn restart(
&self,
name: &str,
) -> impl Future<Output = Result<(), LifecycleHandleError>> + Send
fn restart( &self, name: &str, ) -> impl Future<Output = Result<(), LifecycleHandleError>> + Send
Restart a single resource by name.
Sourcefn logs(
&self,
name: &str,
follow: bool,
) -> impl Future<Output = Result<LogChunkStream, LifecycleHandleError>> + Send
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.
Sourcefn subscribe_events(&self) -> Receiver<LifecycleEvent>
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".