6 releases

0.1.5 May 21, 2024
0.1.4 May 21, 2024
0.1.3 Nov 20, 2023

#78 in Value formatting

Download history 212/week @ 2024-12-16 25/week @ 2024-12-23 62/week @ 2024-12-30 182/week @ 2025-01-06 306/week @ 2025-01-13 352/week @ 2025-01-20 291/week @ 2025-01-27 247/week @ 2025-02-03 250/week @ 2025-02-10 204/week @ 2025-02-17 238/week @ 2025-02-24 215/week @ 2025-03-03 189/week @ 2025-03-10 141/week @ 2025-03-17 260/week @ 2025-03-24 289/week @ 2025-03-31

881 downloads per month
Used in 2 crates

Apache-2.0

8KB
178 lines

Hide credentials from debug output

Example

use hide::Hide;

#[derive(Debug)]
pub struct MyStruct {
    username: String,
    password: Hide<String>,
}

fn example1() {
    let data = MyStruct {
        username: "user".to_string(),
        password: "password".to_string().into(),
    };
    println!("{data:#?}");
}

hide (from debug)

crates.io docs.rs

Hide secrets from logs.

Seriously?

You might ask: "A crate, for a simple feature like this?". Yes, maybe this type will be shared between crates. Compared to multiple different types in different crates.

Add to your project

hide = "0.1

Usage

use hide::Hide;

#[derive(Debug)]
pub struct MyStruct {
    username: String,
    password: Hide<String>,
}

fn example1() {
    let data = MyStruct {
        username: "user".to_string(),
        password: "password".to_string().into(),
    };
    println!("{data:#?}");
}

Will give you:

MyStruct {
    username: "user",
    password: ***,
}

Dependencies

~0–320KB