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;
pub use $crate::head as first;

Modules§

lib

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§

VERSION
See lodash VERSION

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