pub enum TransformOp {
Show 19 variants
Map {
expr: String,
},
Filter {
expr: String,
},
Pick {
fields: Vec<String>,
},
Omit {
fields: Vec<String>,
},
Sort {
by: String,
desc: bool,
},
Group {
by: String,
},
Unique {
by: Option<String>,
},
Slice {
start: usize,
end: Option<usize>,
},
First,
Last,
Flatten,
Join {
sep: String,
},
Split {
sep: String,
},
Merge {
with: Value,
},
Count,
Sum {
by: Option<String>,
},
Min {
by: Option<String>,
},
Max {
by: Option<String>,
},
Exists {
expr: Option<String>,
},
}Expand description
One step of a chain. A chain reads top to bottom, each result feeding the next.
Variants§
Map
A list in, a list out: expr per element.
Filter
Keep the elements for which expr is true.
Pick
Keep only these top-level keys of an object, or of every object in a list.
Omit
The opposite of pick.
Sort
Stable sort of a list by the value of by (an expression from item, such as item.age).
Group
An object from the key of by (as a string) to the list of elements with it, in input order.
Unique
Drop repeats, keeping the first: by whole value, or by the value of by.
Slice
start..end of a list (end absent: to the end); out-of-range ends are clamped.
First
The first element, or null for an empty list.
Last
The last element, or null for an empty list.
Flatten
One level of lists flattened; non-list elements stay.
Join
A list of strings or numbers as one string.
Split
A string as a list of strings.
Merge
The input object with with merged over it (shallow; with wins).
Count
The number of elements of a list, of keys of an object, or characters of a string.
Sum
The sum of a list of numbers, or of by over a list of objects.
Min
The smallest, by the same rule as sum; null for an empty list.
Max
The largest, by the same rule as sum; null for an empty list.
Exists
Whether a list has an element for which expr is true (any element when expr is absent), or an object has a non-null path expr (a dotted path from the object itself, with no item).
Trait Implementations§
Source§impl Clone for TransformOp
impl Clone for TransformOp
Source§fn clone(&self) -> TransformOp
fn clone(&self) -> TransformOp
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TransformOp
impl Debug for TransformOp
Source§impl<'de> Deserialize<'de> for TransformOp
impl<'de> Deserialize<'de> for TransformOp
Source§fn 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>,
Source§impl PartialEq for TransformOp
impl PartialEq for TransformOp
Source§impl Serialize for TransformOp
impl Serialize for TransformOp
impl StructuralPartialEq for TransformOp
Auto Trait Implementations§
impl Freeze for TransformOp
impl RefUnwindSafe for TransformOp
impl Send for TransformOp
impl Sync for TransformOp
impl Unpin for TransformOp
impl UnsafeUnpin for TransformOp
impl UnwindSafe for TransformOp
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more