inspect-rs 0.1.0

Universal introspection for Rust
Documentation
use inspect_rs::{Inspect, InspectCx, format_tree};

#[derive(Inspect)]
struct Credentials {
    username: String,

    #[inspect(secret)]
    password: String,

    #[inspect(sensitive)]
    email: String,

    #[inspect(skip)]
    #[allow(dead_code)]
    internal_id: u64,
}

fn main() {
    let creds = Credentials {
        username: "alice".to_string(),
        password: "super_secret_123".to_string(),
        email: "alice@example.com".to_string(),
        internal_id: 999,
    };

    let mut cx = InspectCx::new();
    let inspected = creds.inspect(&mut cx);

    println!("{}", format_tree(&inspected));
    println!("\nNote: password is redacted, email is marked sensitive, internal_id is skipped");
}