use crate::execution::{
commander::{Commander, Instance},
progress::Observation,
BoxError, BoxFuture, BoxInstance, BoxStream,
};
use futures_lite::stream::once;
impl Commander for () {
fn start(&self) -> Result<BoxInstance, BoxError> {
Ok(Box::new(()))
}
}
impl Instance for () {
fn shutdown(&mut self) -> BoxFuture<Result<BoxStream<Observation>, BoxError>> {
Box::pin(
async move { Ok(Box::pin(once(Observation::Completed(0))) as BoxStream<Observation>) },
)
}
fn execute(
&mut self,
_command: &str,
) -> BoxFuture<Result<BoxStream<Observation>, BoxError>> {
Box::pin(async move {
Ok(Box::pin(once(Observation::Failure {
message: "No interpretter".into(),
source: None,
})) as BoxStream<Observation>)
})
}
}