use futures::Stream;
use crate::cli::command::CommandRequest;
use crate::cli::command::CommandResponse;
pub mod binary;
pub mod plugin;
pub use binary::BinaryExecutor;
pub trait CommandExecutor {
type Error: Send + 'static;
type Stream<T>: Stream<Item = Result<T, Self::Error>> + Send + 'static
where
T: Send + 'static;
fn execute<R, T>(
&self,
request: R,
agent_arguments: Option<&super::AgentArguments>,
) -> impl Future<Output = Result<Self::Stream<T>, Self::Error>> + Send
where
R: CommandRequest + Send,
T: CommandResponse + serde::Serialize + serde::de::DeserializeOwned + Send + 'static;
fn execute_one<R, T>(
&self,
request: R,
agent_arguments: Option<&super::AgentArguments>,
) -> impl Future<Output = Result<T, Self::Error>> + Send
where
R: CommandRequest + Send,
T: CommandResponse + serde::Serialize + serde::de::DeserializeOwned + Send + 'static;
}