pub fn apply_pipeline(rows: Vec<Row>, stages: &[String]) -> Result<OutputResult>Expand description
Apply a pipeline to plain row output.
Use this when a command has already produced Vec<Row> and you want the
ordinary osp pipeline behavior without thinking about existing output
metadata.
This starts with wants_copy = false because there is no prior output meta
to preserve.
ยงExamples
use osp_cli::dsl::apply_pipeline;
use osp_cli::row;
let output = apply_pipeline(
vec![
row! { "uid" => "alice", "team" => "ops" },
row! { "uid" => "bob", "team" => "infra" },
],
&["F team=ops".to_string(), "P uid".to_string()],
)?;
let rows = output.as_rows().unwrap();
assert_eq!(rows.len(), 1);
assert_eq!(rows[0]["uid"], "alice");
assert!(!rows[0].contains_key("team"));