Skip to content

module

json

JSON → template values.

Functions

columns

pub fn columns(rows: &Value, skip: &[&str]) -> Value

Table columns ({key, label} records, as Table expects) from the fields of the first record in rows, minus skip. Labels are humanised: created_at → "Created at".

humanize

pub fn humanize(key: &str) -> String

created_at / createdAt → "Created at".

to_json

pub fn to_json(v: &Value) -> Value

Convert a template Value back into JSON.

to_value

pub fn to_value(j: &Value) -> Value

Convert JSON into a template Value: objects become records, arrays lists, numbers Num.