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(String, Vec<Spanned<Self>>),
Try(Box<Spanned<Self>>),
Neg(Box<Spanned<Self>>),
Recurse,
Binary(Box<Spanned<Self>>, BinaryOp, Box<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(String, Vec<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>>, BinaryOp, Box<Spanned<Self>>)
Binary operation, such as 0, 1, [] | .[], .[] += 1, 0 == 0, …
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Filter
impl<'de> Deserialize<'de> for Filter
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Filter
impl Send for Filter
impl Sync for Filter
impl Unpin for Filter
impl UnwindSafe for Filter
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more