use crate::host::scene_context::*;
use crate::host::scene_message::*;
use crate::host::commands::*;
use futures::prelude::*;
pub trait Command : Send + Clone {
type Input: 'static + SceneMessage;
type Output: 'static + SceneMessage;
fn run<'a>(&'a self, input: impl 'static + Send + Stream<Item=Self::Input>, context: SceneContext) -> impl 'a + Send + Future<Output=()>;
}
pub trait CommandExt : Command {
fn pipe_to<TTargetCommand: 'static + Command<Input=Self::Output>>(&self, target: TTargetCommand) -> PipeCommand<Self, TTargetCommand>;
}
impl<TCommand: 'static + Command> CommandExt for TCommand {
#[inline]
fn pipe_to<TTargetCommand: 'static + Command<Input=Self::Output>>(&self, target: TTargetCommand) -> PipeCommand<Self, TTargetCommand> {
PipeCommand::new(self.clone(), target)
}
}