44 lines
1.3 KiB
Rust
Raw Normal View History

2026-02-05 08:23:14 +02:00
use async_trait::async_trait;
2026-02-02 07:19:22 +01:00
use crate::scenario::{Application, DynError, StartNodeOptions, StartedNode};
2026-02-05 08:23:14 +02:00
/// Deployer-agnostic control surface for runtime node operations.
#[async_trait]
2026-02-02 07:19:22 +01:00
pub trait NodeControlHandle<E: Application>: Send + Sync {
2026-02-05 08:23:14 +02:00
async fn restart_node(&self, _name: &str) -> Result<(), DynError> {
Err("restart_node not supported by this deployer".into())
}
2026-02-02 07:19:22 +01:00
async fn start_node(&self, _name: &str) -> Result<StartedNode<E>, DynError> {
2026-02-05 08:23:14 +02:00
Err("start_node not supported by this deployer".into())
}
async fn start_node_with(
&self,
_name: &str,
2026-02-02 07:19:22 +01:00
_options: StartNodeOptions<E>,
) -> Result<StartedNode<E>, DynError> {
2026-02-05 08:23:14 +02:00
Err("start_node_with not supported by this deployer".into())
}
async fn stop_node(&self, _name: &str) -> Result<(), DynError> {
Err("stop_node not supported by this deployer".into())
}
2026-02-02 07:19:22 +01:00
fn node_client(&self, _name: &str) -> Option<E::NodeClient> {
2026-02-05 08:23:14 +02:00
None
}
fn node_pid(&self, _name: &str) -> Option<u32> {
None
}
}
/// Deployer-agnostic wait surface for cluster readiness checks.
#[async_trait]
pub trait ClusterWaitHandle<E: Application>: Send + Sync {
async fn wait_network_ready(&self) -> Result<(), DynError> {
Err("wait_network_ready not supported by this deployer".into())
}
}