设为首页 - 加入收藏
广告 1000x90
您的当前位置:当前位置: 首页 >

正文

如何看待 Rust 这门语言?

来源: 编辑: 时间:2025-06-21 23:15:16

最近学习了一个特别有意思的 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:pagebreak/}

相关文章:

    {dede:likearticle row='10' channelid='1' typeid="all"}
  • [/]
  • {/dede:likearticle}

相关推荐:

  • [/]
  • [/]
  • [/]
  • [/]
  • [/]
  • [/]
  • [/]
  • [/]
  • [/]
  • [/]

网友评论:

{dede:include file='ajaxfeedback.htm' /}

模板天下 www.mobantianxia.com 联系QQ:498872301 邮箱:498872301@qq.com

版权@|备案:晋-ICP备79567910号-1|网站地图

Top