Function size

Source
pub fn size(
    ftx: &FunctionContext<'_>,
    This: This<Value>,
) -> Result<i64, ExecutionError>
Expand description

Calculates the size of either the target, or the provided args depending on how the function is called.

If called as a method, the target will be used. If called as a function, the first argument will be used.

The following Value variants are supported:

ยงExamples

size([1, 2, 3]) == 3
'foobar'.size() == 6