6 个版本

0.1.5 2024年5月21日
0.1.4 2024年5月21日
0.1.3 2023年11月20日

#309开发工具

Download history 129/week @ 2024-05-01 148/week @ 2024-05-08 393/week @ 2024-05-15 371/week @ 2024-05-22 400/week @ 2024-05-29 574/week @ 2024-06-05 240/week @ 2024-06-12 518/week @ 2024-06-19 486/week @ 2024-06-26 439/week @ 2024-07-03 379/week @ 2024-07-10 669/week @ 2024-07-17 482/week @ 2024-07-24 411/week @ 2024-07-31 253/week @ 2024-08-07 181/week @ 2024-08-14

1,395 每月下载量
2 个 包中使用

Apache-2.0 许可证

8KB
178

隐藏(从调试中)

crates.io docs.rs

从日志中隐藏秘密。

真的吗?

你可能会问:“这样一个简单的功能也需要一个包吗?”是的,也许这个类型将在不同的包之间共享。与不同包中的多个不同类型相比。

添加到您的项目中

hide = "0.1

用法

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:#?}");
}

将为您提供

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

lib.rs:

从调试输出中隐藏凭证

示例

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:#?}");
}

依赖项

~0–330KB