百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
N

nutype

> 编程语言
开源

带保证的 Rust 新类型

1.8K stars0 点赞1 次浏览
访问官网GitHub

工具介绍

带保证的 Rust 新类型

具有保证的新类型。

Nutype 是一个 proc 宏,允许在常规 [newtype 模式](https://doc.rust-lang.org/rust-by-example/generics/new_types.html) 中添加额外的约束,如 _sanitization_ 和 _validation_。生成的代码使得在不通过检查的情况下无法实例化值。即使在使用 `serde` 反序列化时,它也以这种方式工作。 * [快速入门](#quick-start) * [内部类型](#inner-types) ([字符串](#string) | [整数](#integer) | [浮点数](#float) | [小数](#decimal) | [其他](#other-inner-types-and-generics)) * [自定义](#custom-sanitizers) ([sanitizers](#custom-sanitizers) | [验证器](#custom-validators) | [错误](#custom-validation-with-a-custom-error-type)) * [派生特性](#deriving-traits) * [常量](#constants) * [配方](#recipes) * [构造函数可见性](#constructor-visibility) * [使用 new_unchecked 打破约束](#breaking-constraints-with-new_unchecked) * [功能标志](#feature-flags) * [支持乌克兰军队](#support-ukrainian-military-forces) * [类似项目](#similar-projects) ## 内部类型

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rustdatadata-structuresinvarianceinvariant

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言