//! Humphrey JSON is a library facilitating the serialization and deserialization of JSON data. It is designed for web applications, but can be used in other contexts, and is well-integrated with the Humphrey web server.
//!
//! Learn more about Humphrey JSON [here](https://humphrey.whenderson.dev/json/index.html).
extern crate self as humphrey_json;
/// Brings useful traits and macros into scope.
///
/// ```
/// use humphrey_json::prelude::*;
/// ```
pub use *;
pub use Value;
/// Deserialize a JSON string into a Rust data structure.
///
/// ## Usage
/// ```
/// use humphrey_json::prelude::*;
///
/// #[derive(FromJson, IntoJson, Debug)]
/// struct User {
/// name: String,
/// country: String,
/// }
///
/// fn main() {
/// let json_string = r#"
/// {
/// "name": "William Henderson",
/// "country": "United Kingdom"
/// }"#;
///
/// let user: User = humphrey_json::from_str(json_string).unwrap();
///
/// println!("{:?}", user);
/// }
/// ```
///
/// ## Errors
/// This function returns a `ParseError` if the JSON string is invalid,
/// or if the JSON string is missing a required field.
/// Serialize a Rust data structure into a JSON string.
///
/// ## Usage
/// ```
/// use humphrey_json::prelude::*;
///
/// #[derive(FromJson, IntoJson)]
/// struct User {
/// name: String,
/// country: String,
/// }
///
/// fn main() {
/// let user = User {
/// name: "William Henderson".into(),
/// country: "United Kingdom".into(),
/// };
///
/// let json_string = humphrey_json::to_string(&user);
///
/// println!("{}", json_string);
/// }
/// ```
/// Serialize a Rust data structure into a JSON string, pretty-printed with indentation.
///
/// For more control over indentation, use [`Value::serialize_pretty`].
///
/// ## Usage
/// ```
/// use humphrey_json::prelude::*;
///
/// #[derive(FromJson, IntoJson)]
/// struct User {
/// name: String,
/// country: String,
/// }
///
/// fn main() {
/// let user = User {
/// name: "William Henderson".into(),
/// country: "United Kingdom".into(),
/// };
///
/// let json_string = humphrey_json::to_string_pretty(&user);
///
/// println!("{}", json_string);
/// }
/// ```