pub trait ToColoredJson {
    // 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;
}
Expand description

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

Required Methods§

source

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

source

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

source

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

source

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

source

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

source

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

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<S> ToColoredJson for S
where S: ?Sized + AsRef<str>,