This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// The `json_parse!` macro automatically generates all `serde_json` `as_` operations based on a provided JSON syntax, binding all variables to the keys. | |
/// When a key cannot be converted, Result is propagated using the `?` operator. | |
/// To handle errors before propagation, you can provide a closure as the first argument to this macro which will be called by `.map_err()`. | |
/// The data argument has to be of type `&Map<String, Value>`. | |
/// | |
/// ## Usage: | |
/// | |
/// ```rust | |
/// json_parse!( | |
/// |err| format!("Could not parse some_data, {}", err), |