pub fn grouping(input: &str) -> IResult<&str, Grouping>Expand description
Parse a grouping clause: by (label1, label2) or without (label1, label2)
ยงExamples
use rusty_promql_parser::parser::aggregation::{grouping, GroupingAction};
let (rest, g) = grouping("by (job, instance)").unwrap();
assert!(rest.is_empty());
assert_eq!(g.action, GroupingAction::By);
assert_eq!(g.labels, vec!["job", "instance"]);
let (rest, g) = grouping("without (job)").unwrap();
assert!(rest.is_empty());
assert_eq!(g.action, GroupingAction::Without);