当前位置: 首页 >

如何看待 Rust 这门语言?

作者: 发布时间:{dede:field name='pubdate'function='strftime("%Y-%m-%d %H:%M:%S",@me)' /}点击:

最近学习了一个特别有意思的 rust 库,叫 secrecy 。

这个库非常简单,简单说,就是一个 wr***er,例如 // configuration.rs use secrecy::Secret; #[derive(serde::Deserialize)] pub struct Settings { pub password: Secret, }这个类型默认故意不实现 std::fmt::Display。

所以,如果你要用一个属性,需要显示声明,例如如果需要使用这个 setting 的 password // configuration.rs use secrecy::ExposeSecret; impl Sett…。

如何看待 Rust 这门语言?
相关标签:{dede:tag row='20' sort='rand'}{/dede:tag}
浙-ICP备29220154号-1|网站地图浙-ICP备29220154号-1|网站地图 【】