[][src]Trait colored_json::ToColoredJson

pub trait ToColoredJson {
    fn to_colored_json_auto(&self) -> Result<String>;
fn to_colored_json(&self, mode: ColorMode) -> Result<String>;
fn to_colored_json_with_styler(
        &self,
        mode: ColorMode,
        styler: Styler
    ) -> Result<String>;
fn write_colored_json<W>(&self, writer: &mut W) -> Result<()>
    where
        W: Write
;
fn write_colored_json_with_mode<W>(
        &self,
        writer: &mut W,
        mode: ColorMode
    ) -> Result<()>
    where
        W: Write
;
fn write_colored_json_with_styler<W>(
        &self,
        writer: &mut W,
        mode: ColorMode,
        styler: Styler
    ) -> Result<()>
    where
        W: Write
; }

Trait to add json coloring for all AsRef<str> like String and &str

Required methods

fn to_colored_json_auto(&self) -> Result<String>

fn to_colored_json(&self, mode: ColorMode) -> Result<String>

fn to_colored_json_with_styler(
    &self,
    mode: ColorMode,
    styler: Styler
) -> Result<String>

fn write_colored_json<W>(&self, writer: &mut W) -> Result<()> where
    W: Write

fn write_colored_json_with_mode<W>(
    &self,
    writer: &mut W,
    mode: ColorMode
) -> Result<()> where
    W: Write

fn write_colored_json_with_styler<W>(
    &self,
    writer: &mut W,
    mode: ColorMode,
    styler: Styler
) -> Result<()> where
    W: Write

Loading content...

Implementors

impl<S: ?Sized> ToColoredJson for S where
    S: AsRef<str>, 
[src]

fn to_colored_json_auto(&self) -> Result<String>[src]

Serialize the given data structure as a pretty-color-printed String of JSON.

Errors

Serialization can fail if T's implementation of Serialize decides to fail, or if T contains a map with non-string keys.

fn to_colored_json(&self, mode: ColorMode) -> Result<String>[src]

Serialize the given data structure as a pretty-color-printed String of JSON.

Errors

Serialization can fail if T's implementation of Serialize decides to fail, or if T contains a map with non-string keys.

fn to_colored_json_with_styler(
    &self,
    mode: ColorMode,
    styler: Styler
) -> Result<String>
[src]

Serialize the given data structure as a pretty-color-printed String of JSON.

Errors

Serialization can fail if T's implementation of Serialize decides to fail, or if T contains a map with non-string keys.

fn write_colored_json<W>(&self, writer: &mut W) -> Result<()> where
    W: Write
[src]

Serialize the given data structure as pretty-color-printed JSON into the IO stream.

Errors

Serialization can fail if T's implementation of Serialize decides to fail, or if T contains a map with non-string keys.

Loading content...