Skip to main content

DebugSimple

Derive Macro DebugSimple 

Source
#[derive(DebugSimple)]
Expand description

Derive macro that implements Debug trait using compact JSON serialization

This generates a Debug implementation that outputs the struct as compact JSON using serde_json::to_string().

ยงExample

use pretty_simple_display::DebugSimple;
use serde::Serialize;

#[derive(Serialize, DebugSimple)]
struct User {
    id: u64,
    name: String,
}

let user = User { id: 1, name: "Alice".to_string() };
println!("{:?}", user); // Compact JSON