pub fn to_string_pretty<T: Serialize>(value: &T) -> Result<String> {
    let mut serializer = Serializer::pretty();
    value.serialize(&mut serializer)?;
    Ok(serializer.finish())
}
/// Serializes the given `value` as a String of pretty-printed Rudano.
///
/// This will generate newlines, indentation, etc.
/// If you're looking for generating compact Rudano, use `to_string_compact` instead.
///
/// # Example
///
/// ```
/// use serde::{Serialize, Deserialize};
///
/// #[derive(Serialize, Deserialize)]
/// struct MyStruct {
///     number: i32,
///     string: String,
/// }
///
/// let value = MyStruct {
///     number: 69,
///     string: "nice".to_string(),
/// };
/// let string = rudano::to_string_pretty(&value).unwrap();
///
/// let expected = r#"MyStruct {
///     number: 69,
///     string: "nice",
/// }"#;
///
/// assert_eq!(string, expected);
/// ```
///
/// # Errors
///
/// Serialization can fail if the structure's Serialize implementation or itoa fails.
Serializes the given `value` as a String of pretty-printed Rudano.
This will generate newlines, indentation, etc.
If you're looking for generating compact Rudano, use `to_string_compact` instead.
Serializes the given ` value ` as a String of pretty - printed Rudano . This will generate newlines indentation etc . If you ' re looking for generating compact Rudano use ` to_string_compact ` instead .
pub fn to_string_pretty<T: Serialize>(value: &T) -> Result<String> {
    let mut serializer = Serializer::pretty();
    value.serialize(&mut serializer)?;
    Ok(serializer.finish())
}
pub fn to_string_pretty < T : Serialize > ( value : & T ) -> Result < String > { let mut serializer = Serializer :: pretty ( ) ; value . serialize ( & mut serializer ) ? ; Ok ( serializer . finish ( ) ) }
Serializes the given `value` as a String of pretty-printed Rudano.
Serializes the given ` value ` as a String of pretty - printed Rudano .
value
&T
value
&T
example
```
use serde::{Serialize, Deserialize}.
` ` ` use serde :: { Serialize Deserialize } .
[derive(serialize, deserialize)]
struct MyStruct {
number: i32,
string: String,
}

let value = MyStruct {
number: 69,
string: "nice".to_string(),
};
let string = rudano::to_string_pretty(&value).unwrap().

let expected = r#"MyStruct {
number: 69,
string: "nice",
}"#.

assert_eq!(string, expected);
```
struct MyStruct { number : i32 string : String } let value = MyStruct { number : 69 string : " nice " . to_string () } ; let string = rudano :: to_string_pretty ( &value ) . unwrap () . let expected = r# " MyStruct { number : 69 string : " nice " } " # . assert_eq! ( string expected ) ; ` ` `
errors
Serialization can fail if the structure's Serialize implementation or itoa fails.
Serialization can fail if the structure ' s Serialize implementation or itoa fails .