#![cfg_attr(feature = "doc-images",
cfg_attr(
all(),
doc = ::embed_doc_image::embed_image!(
"executable-command-diagram",
"src/aggregates/executable_command/executable_command.svg"
)))]
#![cfg_attr(
not(feature = "doc-images"),
doc = "**Doc images not enabled**. Compile with feature `doc-images` and \
Rust version >= 1.54 to enable."
)]
use crate::prelude::*;
use delegate::delegate;
pub mod prelude
{
pub use super::ExecutableCommand;
}
pub struct ExecutableCommand<C>
where
C: Command,
{
command: C,
}
impl<C> ExecutableCommand<C>
where
C: Command,
{
pub fn new(command: C) -> ExecutableCommand<C>
{
ExecutableCommand { command }
}
}
#[allow(clippy::inline_always)]
impl<C> Executable for ExecutableCommand<C>
where
C: Command,
{
delegate! {
to self.command {
fn execute(&self);
}
}
}
#[allow(clippy::inline_always)]
impl<C> Command for ExecutableCommand<C>
where
C: Command,
{
delegate! {
to self.command {
fn execute(&self);
}
}
}
impl<C> From<C> for ExecutableCommand<C>
where
C: Command,
{
fn from(command: C) -> Self
{
ExecutableCommand::new(command)
}
}