pub enum Filter {
Show 15 variants Id, Num(String), Str(String), Var(String), Array(Option<Box<Spanned<Self>>>), Object(Vec<KeyVal>), Path(Box<Spanned<Self>>, Path<Self>), If(Vec<(Spanned<Self>, Spanned<Self>)>, Box<Spanned<Self>>), Reduce(Fold<Box<Spanned<Self>>>), Foreach(Fold<Box<Spanned<Self>>>, Option<Box<Spanned<Self>>>), Call(StringVec<Spanned<Self>>), Try(Box<Spanned<Self>>), Neg(Box<Spanned<Self>>), Recurse, Binary(Box<Spanned<Self>>, BinaryOpBox<Spanned<Self>>),
}
Expand description

Function from value to stream of values, such as .[] | add / length.

Variants

Id

Identity, i.e. .

Num(String)

Integer or floating-point number.

Str(String)

String

Var(String)

Variable, such as $x (without leading ‘$’)

Array(Option<Box<Spanned<Self>>>)

Array, empty if None

Object(Vec<KeyVal>)

Object, specifying its key-value pairs

Path(Box<Spanned<Self>>, Path<Self>)

Path such as ., .a, .[][]."b"

If(Vec<(Spanned<Self>, Spanned<Self>)>, Box<Spanned<Self>>)

If-then-else

Reduce(Fold<Box<Spanned<Self>>>)

Reduction, e.g. reduce .[] as $x (0; .+$x)

Foreach(Fold<Box<Spanned<Self>>>, Option<Box<Spanned<Self>>>)

Reduction returning intermediate results

Call(StringVec<Spanned<Self>>)

Call to another filter, e.g. map(.+1)

Try(Box<Spanned<Self>>)

Error suppression, e.g. keys?

Neg(Box<Spanned<Self>>)

Negation

Recurse

Recursion (..)

Binary(Box<Spanned<Self>>, BinaryOpBox<Spanned<Self>>)

Binary operation, such as 0, 1, [] | .[], .[] += 1, 0 == 0, …

Trait Implementations

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Converts to this type from the input type.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

The number of items that this chain link consists of.

Append the elements in this link to the chain.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.