at_modifier

Function at_modifier 

Source
pub fn at_modifier(input: &str) -> IResult<&str, AtModifier>
Expand description

Parse the @ modifier: @ <timestamp>, @ start(), @ end()

The @ modifier allows pinning a query to a specific timestamp, or to the start/end of the evaluation range.

ยงExamples

use rusty_promql_parser::parser::selector::at_modifier;

// Timestamp in seconds
let (rest, at) = at_modifier(" @ 1603774568").unwrap();
assert!(rest.is_empty());

// start() preprocessor
let (rest, at) = at_modifier(" @ start()").unwrap();
assert!(rest.is_empty());

// end() preprocessor
let (rest, at) = at_modifier(" @ end()").unwrap();
assert!(rest.is_empty());