fn filter_expression<'a, E>(input: &'a str) -> IResult<&'a str, FilterExpression<'a>, E>
where
    E: NomParseError<&'a str>,
{
    let (rest, identifier) = spaced(identifier)(input)?;
    let (rest, operator) = spaced(operator)(rest)?;
    let (rest, value) =
        // TODO(fxbug.dev/86960): similar to severities, we can probably have reserved values
        // for lifecycle event types.
        // TODO(fxbug.dev/86961): support time diferences (1h30m, 30s, etc) instead of only
        // timestamp comparison.
        spaced(alt((
            map(number, move |n| OneOrMany::One(Value::Number(n))),
            map(severity_sym, move |s| OneOrMany::One(Value::Severity(s))),
            map(string_literal, move |s| OneOrMany::One(Value::StringLiteral(s))),
            map(list_of_values, OneOrMany::Many),
        )))(rest)?;
    Ok((rest, FilterExpression { identifier, operator, value }))
}
/// Parses a single filter expression in a metadata selector.
Parses a single filter expression in a metadata selector.
Parses a single filter expression in a metadata selector .
fn filter_expression<'a, E>(input: &'a str) -> IResult<&'a str, FilterExpression<'a>, E>
where
    E: NomParseError<&'a str>,
{
    let (rest, identifier) = spaced(identifier)(input)?;
    let (rest, operator) = spaced(operator)(rest)?;
    let (rest, value) =
        // TODO(fxbug.dev/86960): similar to severities, we can probably have reserved values
        // for lifecycle event types.
        // TODO(fxbug.dev/86961): support time diferences (1h30m, 30s, etc) instead of only
        // timestamp comparison.
        spaced(alt((
            map(number, move |n| OneOrMany::One(Value::Number(n))),
            map(severity_sym, move |s| OneOrMany::One(Value::Severity(s))),
            map(string_literal, move |s| OneOrMany::One(Value::StringLiteral(s))),
            map(list_of_values, OneOrMany::Many),
        )))(rest)?;
    Ok((rest, FilterExpression { identifier, operator, value }))
}
fn filter_expression < ' a , E > ( input : & ' a str ) -> IResult < & ' a str , FilterExpression < ' a > , E > where E : NomParseError < & ' a str > , { let ( rest , identifier ) = spaced ( identifier ) ( input ) ? ; let ( rest , operator ) = spaced ( operator ) ( rest ) ? ; let ( rest , value ) = // TODO(fxbug.dev/86960): similar to severities, we can probably have reserved values // for lifecycle event types. // TODO(fxbug.dev/86961): support time diferences (1h30m, 30s, etc) instead of only // timestamp comparison. spaced ( alt ( ( map ( number , move | n | OneOrMany :: One ( Value :: Number ( n ) ) ) , map ( severity_sym , move | s | OneOrMany :: One ( Value :: Severity ( s ) ) ) , map ( string_literal , move | s | OneOrMany :: One ( Value :: StringLiteral ( s ) ) ) , map ( list_of_values , OneOrMany :: Many ) , ) ) ) ( rest ) ? ; Ok ( ( rest , FilterExpression { identifier , operator , value } ) ) }
Parses a single filter expression in a metadata selector.
Parses a single filter expression in a metadata selector .
input
&'a str
input
&'a str