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§
Modules§
Macros§
- add
- Based on add()
- capitalize
- Based on capitalize()
- capitalize_
x - Based on capitalize_x()
- ceil
- Based on ceil()
- chunk
- Based on chunk()
- compact
- Based on compact()
- concat
- Based on concat()
- difference
- Based on difference()
- drop
- Based on drop()
- drop_
right - Based on drop_right()
- fill
- Based on fill()
- find_
index - Based on find_index()
- find_
last_ index - Based on find_last_index()
- first
- See lodash first Based on head()
- flatten
- Based on flatten()
- flatten_
deep - Based on flatten_deep()
- flatten_
depth - Based on flatten_depth()
- from_
pairs - Based on from_pairs()
- get
- Based on get()
- head
- Based on head()
- index_
of - Based on index_of()
- initial
- Based on initial()
- intersection
- Based on intersection()
- intersection_
x - Based on intersection_x()
- join
- Based on join()
- join_x
- Based on join_x()
- last
- Based on last()
- last_
index_ of - Based on last_index_of()
- merge
- Based on merge()
- nth
- Based on nth()
- pull
- Based on pull()
- pull_
all - Based on pull_all()
- pull_
all_ by - Based on pull_all_by()
- pull_
all_ with - Based on pull_all_with()
- pull_at
- Based on pull_at()
- range
- Based on range()
- range_
right - Based on range_right()
- range_
right_ x - Based on range_right_x()
- range_x
- Based on range_x()
- set
- Based on set()
- stub_
array - Based on stub_array()
- stub_
false - Based on stub_false()
- stub_
object - Based on stub_object()
- stub_
string - Based on stub_string()
- stub_
true - Based on stub_true()
- times
- Based on times()
- to_
lower - Based on to_lower()
- to_
lower_ x - Based on to_lower_x()
- to_path
- Based on to_path()
- to_
path_ x - Based on to_path_x()
- to_
safe_ integer - Based on to_safe_integer()
- to_
safe_ integer_ x - Based on to_safe_integer_x()
- to_
string - Based on to_string()
- to_
string_ x - Based on to_string_x()
- x_add_x
- Based on x_add_x()
- x_
capitalize - Based on x_capitalize()
- x_
capitalize_ x - Based on x_capitalize_x()
- x_
ceil_ x - Based on x_ceil_x()
- x_range
- Based on x_range()
- x_
range_ right - Based on x_range_right()
- x_
range_ right_ x - Based on x_range_right_x()
- x_
range_ x - Based on x_range_x()
- x_times
- Based on x_times()
- x_
to_ lower - Based on x_to_lower()
- x_
to_ lower_ x - Based on x_to_lower_x()
- x_
to_ path - Based on x_to_path()
- x_
to_ path_ x - Based on x_to_path_x()
- x_
to_ string - Based on x_to_string()
Constants§
Functions§
- add
- See lodash add
- capitalize
- See lodash capitalize
- capitalize_
x - ceil
- See lodash ceil
- chunk
- See lodash chunk
- compact
- See lodash compact
- concat
- See lodash concat
- difference
- See lodash difference
- drop
- See lodash drop
- drop_
right - See lodash dropRight
- fill
- See lodash fill
- find_
index - See lodash findIndex
- find_
last_ index - See lodash findLastIndex
- flatten
- See lodash flatten
- flatten_
deep - See lodash flattenDeep
- flatten_
depth - See lodash flattenDepth
- from_
pairs - See lodash fromPairs
- get
- See lodash get
- head
- See lodash head
- index_
of - See lodash indexOf
- initial
- See lodash initial
- intersection
- See lodash intersection
- intersection_
x - join
- See lodash join
- join_x
- last
- See lodash last
- last_
index_ of - See lodash lastIndexOf
- merge
- See lodash merge
- nth
- See lodash nth
- pull
- See lodash pull
- pull_
all - See lodash pullAll
- pull_
all_ by - See lodash pullAllBy
- pull_
all_ with - See lodash pullAllWith
- pull_at
- See lodash pullAt
- range
- See lodash range
- range_
right - See lodash rangeRight
- range_
right_ x - range_x
- set
- See lodash set
- stub_
array - See lodash stubArray
- stub_
false - See lodash stubFalse
- stub_
object - See lodash stubObject
- stub_
string - See lodash stubString
- stub_
true - See lodash stubTrue
- times
- See lodash times
- to_
lower - See lodash toLower
- to_
lower_ x - to_path
- See lodash toPath
- to_
path_ x - to_
safe_ integer - See lodash toSafeInteger
- to_
safe_ integer_ x - to_
string - See lodash toString
- to_
string_ x - x_add_x
- x_
capitalize - x_
capitalize_ x - x_ceil
- x_
ceil_ x - x_
flatten_ deep_ x - x_
flatten_ depth_ x - x_
flatten_ x - x_range
- x_
range_ right - x_
range_ right_ x - x_
range_ x - x_times
- x_
to_ lower - x_
to_ lower_ x - x_
to_ path - x_
to_ path_ x - x_
to_ string