6 releases

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

#390 in Value formatting

Download history 240/week @ 2026-03-29 314/week @ 2026-04-05 473/week @ 2026-04-12 613/week @ 2026-04-19 323/week @ 2026-04-26 370/week @ 2026-05-03 242/week @ 2026-05-10 318/week @ 2026-05-17 254/week @ 2026-05-24 538/week @ 2026-05-31 835/week @ 2026-06-07 636/week @ 2026-06-14 474/week @ 2026-06-21 975/week @ 2026-06-28 1183/week @ 2026-07-05 1061/week @ 2026-07-12

3,702 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–410KB