pub enum ArrayMethodCall {
Show 28 variants
Map {
item_var: String,
body: Box<ValueExpr>,
},
Filter {
item_var: String,
predicate: Box<ValueExpr>,
},
Find {
item_var: String,
predicate: Box<ValueExpr>,
},
Slice {
start: usize,
end: Option<usize>,
},
Length,
Some {
item_var: String,
predicate: Box<ValueExpr>,
},
Every {
item_var: String,
predicate: Box<ValueExpr>,
},
Reduce {
acc_var: String,
item_var: String,
body: Box<ValueExpr>,
initial: Box<ValueExpr>,
},
Push {
item: Box<ValueExpr>,
},
Concat {
other: Box<ValueExpr>,
},
Includes {
item: Box<ValueExpr>,
},
IndexOf {
item: Box<ValueExpr>,
},
Join {
separator: Option<String>,
},
Reverse,
Sort {
comparator: Option<(String, String, Box<ValueExpr>)>,
},
Flat,
FlatMap {
item_var: String,
body: Box<ValueExpr>,
},
First,
Last,
ToLowerCase,
ToUpperCase,
StartsWith {
search: Box<ValueExpr>,
},
EndsWith {
search: Box<ValueExpr>,
},
Trim,
Replace {
search: Box<ValueExpr>,
replacement: Box<ValueExpr>,
},
Split {
separator: Box<ValueExpr>,
},
Substring {
start: Box<ValueExpr>,
end: Option<Box<ValueExpr>>,
},
ToString,
}Expand description
Array method calls.
Variants§
Map
.map(x => expr)
Filter
.filter(x => expr)
Find
.find(x => expr)
Slice
.slice(start, end)
Length
.length
Some
.some(x => expr)
Every
.every(x => expr)
Reduce
.reduce((acc, x) => expr, init)
Push
.push(item) - returns new array (pure)
Concat
.concat(other)
Includes
.includes(item)
IndexOf
.indexOf(item)
Join
.join(separator)
Reverse
.reverse() - returns new array (pure)
Sort
.sort() or .sort((a, b) => expr) - returns new array (pure)
Flat
.flat() - flatten nested arrays
FlatMap
.flatMap(x => expr)
First
Get first element: [0] or .at(0)
Last
Get last element: .at(-1)
ToLowerCase
.toLowerCase() (string-only)
ToUpperCase
.toUpperCase() (string-only)
StartsWith
.startsWith(searchString)
EndsWith
.endsWith(searchString)
Trim
.trim()
Replace
.replace(search, replacement) — first occurrence only
Split
.split(separator)
Substring
.substring(start, end?)
ToString
.toString() — works on strings (identity), numbers, arrays, objects
Trait Implementations§
Source§impl Clone for ArrayMethodCall
impl Clone for ArrayMethodCall
Source§fn clone(&self) -> ArrayMethodCall
fn clone(&self) -> ArrayMethodCall
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ArrayMethodCall
impl Debug for ArrayMethodCall
Auto Trait Implementations§
impl Freeze for ArrayMethodCall
impl RefUnwindSafe for ArrayMethodCall
impl Send for ArrayMethodCall
impl Sync for ArrayMethodCall
impl Unpin for ArrayMethodCall
impl UnsafeUnpin for ArrayMethodCall
impl UnwindSafe for ArrayMethodCall
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.