Crate termcolor_json[][src]

Expand description

A library for writing colored JSON output to a termcolor terminal.

let stdout = StandardStream::stdout(ColorChoice::Auto);

termcolor_json::to_writer(
    &mut stdout.lock(),
    &serde_json::json!({
        "string": "value",
        "number": 123,
        "bool": true,
        "null": null,
    }),
)?;

Structs

Controls the console formatter used for different JSON tokens.

Functions

Serialize the given data structure as colored, pretty-printed JSON into the IO stream, using the default theme.

Serialize the given data structure as colored, compact JSON into the IO stream, using the default theme.

Serialize the given data structure as colored, pretty-printed JSON into the IO stream, using the given theme.

Serialize the given data structure as colored JSON into the IO stream, using the given theme and formatter.