Crate serde_json_lodash
source · [−]Expand description
serde_json_lodash
A library uses lodash.js style functions to handle serde_json::Value
Usage
#[macro_use] extern crate serde_json_lodash;
use serde_json::json;
fn main() {
// macro style, optional parameters
assert_eq!(
merge!(json!({'a':1}), json!({'b':2}), json!({'c':3})),
json!({'a': 1, 'b': 2, 'c': 3})
);
// fn style, fixed parameters
use serde_json_lodash::merge;
assert_eq!(
merge(json!({'a':1}), json!({'b':2})),
json!({'a': 1, 'b': 2})
);
// `x_`, `_x` helpers for simple types
assert_eq!(capitalize!(json!("FRED")), json!("Fred"));
assert_eq!(x_capitalize!("FRED"), json!("Fred"));
assert_eq!(capitalize_x!(json!("FRED")), "Fred".to_owned());
assert_eq!(x_capitalize_x!("FRED"), "Fred".to_owned());
}
Re-exports
pub use $crate::head as first;
Modules
Macros
Based on capitalize()
Based on capitalize_x()
Based on difference()
Based on drop_right()
Based on find_index()
Based on find_last_index()
Based on flatten_deep()
Based on flatten_depth()
Based on from_pairs()
Based on index_of()
Based on intersection()
Based on intersection_x()
Based on last_index_of()
Based on pull_all()
Based on pull_all_by()
Based on pull_all_with()
Based on range_right()
Based on range_right_x()
Based on stub_array()
Based on stub_false()
Based on stub_object()
Based on stub_string()
Based on stub_true()
Based on to_lower()
Based on to_lower_x()
Based on to_path_x()
Based on to_safe_integer()
Based on to_safe_integer_x()
Based on to_string()
Based on to_string_x()
Based on x_capitalize()
Based on x_capitalize_x()
Based on x_ceil_x()
Based on x_range_right()
Based on x_range_right_x()
Based on x_range_x()
Based on x_to_lower()
Based on x_to_lower_x()
Based on x_to_path()
Based on x_to_path_x()
Based on x_to_string()
Constants
Functions
See lodash capitalize
See lodash difference
See lodash dropRight
See lodash findIndex
See lodash findLastIndex
See lodash flattenDeep
See lodash flattenDepth
See lodash fromPairs
See lodash intersection
See lodash lastIndexOf
See lodash pullAllBy
See lodash pullAllWith
See lodash rangeRight
See lodash stubArray
See lodash stubFalse
See lodash stubObject
See lodash stubString
See lodash toSafeInteger