use async_trait::async_trait;
use crate::{runtime::remote::RemoteRuntime, Identifier};
pub trait Environment {
fn identifier(&self) -> Identifier;
fn runtimes(&self) -> Vec<RemoteRuntime>;
}
#[derive(Debug)]
pub enum EnvironmentRuntimeEvent {
Arrived(RemoteRuntime),
Left(RemoteRuntime),
}
#[async_trait(?Send)]
pub trait DiscoveryEnvironment: Environment {
async fn start_discovery(&mut self) -> Result<(), crate::Error>;
async fn stop_discovery(&mut self) -> Result<(), crate::Error>;
async fn next_runtime_event(&self) -> Result<EnvironmentRuntimeEvent, crate::Error>;
}