Struct json_color::Colorizer
[−]
[src]
pub struct Colorizer { pub null: Color, pub boolean: Color, pub number: Color, pub string: Color, pub key: Color, }
A struct representing a specific configuration of colors for the various JSON components.
Fields
null: Color
boolean: Color
number: Color
string: Color
key: Color
Methods
impl Colorizer
[src]
fn new() -> ColorizerBuilder
Start builder a new Colorizer.
fn arbitrary() -> Self
Creates a new Colorizer with a predefined set of colors for the various JSON components.
Use this if you want your JSON to be colored, but don't care about the specific colors.
fn colorize_json_str(&self, s: &str) -> Result<String, Error>
Colorize a JSON string. Currently, all strings will be pretty-printed (with indentation and spacing).
Errors
An error is returned if the string is invalid JSON or an I/O error occurs.