rust_helpers

Trait DebugExt

Source
pub trait DebugExt: Debug + Sized {
    // Provided methods
    fn dprintln(self, msg: &'static str) -> Self { ... }
    fn deprintln(self, msg: &'static str) -> Self { ... }
    fn dprintln_dbg(self, msg: &'static str) -> Self { ... }
    fn deprintln_dbg(self, msg: &'static str) -> Self { ... }
    fn dpprintln(self, msg: &'static str) -> Self { ... }
    fn depprintln(self, msg: &'static str) -> Self { ... }
    fn dpprintln_dbg(self, msg: &'static str) -> Self { ... }
    fn depprintln_dbg(self, msg: &'static str) -> Self { ... }
    fn dbg(self) -> Self { ... }
    fn dbg_dbg(self) -> Self { ... }
    fn dbg_tagged(self, tag: &str) -> Self { ... }
    fn dbg_tagged_dbg(self, tag: &str) -> Self { ... }
}

Provided Methods§

Source

fn dprintln(self, msg: &'static str) -> Self

pritnln!(“{msg}: {self:?}”);

Source

fn deprintln(self, msg: &'static str) -> Self

eprintln!(“{msg}: {self:?}”);

Source

fn dprintln_dbg(self, msg: &'static str) -> Self

println!(“{msg}: {self:?}”); only in debug builds

Source

fn deprintln_dbg(self, msg: &'static str) -> Self

eprintln!(“{msg}: {self:?}”); only in debug builds

Source

fn dpprintln(self, msg: &'static str) -> Self

println!(“{msg}: {self:#?}”); pretty println

Source

fn depprintln(self, msg: &'static str) -> Self

eprintln!(“{msg}: {self:#?}”); pretty eprintln

Source

fn dpprintln_dbg(self, msg: &'static str) -> Self

println!(“{msg}: {self:#?}”); pretty println only in debug builds

Source

fn depprintln_dbg(self, msg: &'static str) -> Self

eprintln!(“{msg}: {self:#?}”); pretty eprintln only in debug builds

Source

fn dbg(self) -> Self

dbg!(self)

Source

fn dbg_dbg(self) -> Self

dbg!(self); only in debug builds

Source

fn dbg_tagged(self, tag: &str) -> Self

Source

fn dbg_tagged_dbg(self, tag: &str) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: Debug> DebugExt for T