Skip to main content

rumtk_pipeline_run

Macro rumtk_pipeline_run 

Source
macro_rules! rumtk_pipeline_run {
    ( $($command:expr),+ ) => { ... };
}
Expand description

Given a series of RUMCommand passed to this macro, prepare and execute the commands in a pipeline. A pipeline here refers to the Unix style pipeline which is the terminal form of a pipeline. The pipeline behaves like it would in the terminal => ls | wc.

See this article and the Unix Philosophy to learn more!

ยงExample

use rumtk_core::{rumtk_pipeline_command, rumtk_pipeline_run, rumtk_resolve_task, rumtk_init_threads};
use rumtk_core::core::RUMResult;
use rumtk_core::strings::RUMStringConversions;
use rumtk_core::types::RUMBuffer;

let f = || -> RUMResult<()> {
    let result = rumtk_pipeline_run!(
        rumtk_pipeline_command!("ls", RUMBuffer::default()),
        rumtk_pipeline_command!("wc")
    )?;

    assert_eq!(result.is_empty(), false, "Pipeline returned no buffer from command wc! => {:?}", &result);
    Ok(())
};

f().unwrap();