6 个版本
0.1.5 | 2024年5月21日 |
---|---|
0.1.4 | 2024年5月21日 |
0.1.3 | 2023年11月20日 |
#309 在 开发工具
1,395 每月下载量
在 2 个 包中使用
8KB
178 行
隐藏(从调试中)
从日志中隐藏秘密。
真的吗?
你可能会问:“这样一个简单的功能也需要一个包吗?”是的,也许这个类型将在不同的包之间共享。与不同包中的多个不同类型相比。
添加到您的项目中
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