【unitrix】 1.3 Cargo.toml 文件解析

发布于:2025-06-13 ⋅ 阅读:(18) ⋅ 点赞:(0)

一、源码

这是一个 Rust 语言项目的 Cargo.toml 文件内容,用于定义 unitrix 包的元数据和配置。

[package]
name = "unitrix" # 必须是唯一的,全crates.io范围内
version = "0.0.4"
description = "Unitrix: A hybrid compile-time/runtime library for physical unit management and 2D matrix transformations. Ideal for scientific computing with `no_std` support."
edition = "2024"
rust-version = "1.86.0" # 最低支持的 Rust 编译器版本
authors = ["liuyuan <375798574@qq.com>"]
documentation = "https://docs.rs/unitrix" # 包的在线文档地址(docs.rs 自动生成)
# 项目源代码仓库地址(GitHub)
repository = "https://github.com/liuyuan77/unitrix"
readme = "README.md"  # README 文件路径(用于 crates.io 展示)
keywords = ["unitrix", "SI", "units", "no_std"]  # 关键词列表,最多5个,用于 crates.io 搜索和分类
categories = ["no-std", "science", "value-formatting"] # 包的分类(crates.io 分类)
license = "MIT OR Apache-2.0"  # 必须使用SPDX标识符

[features]
std = []

二、内容解析

  1. 基础信息:
  • name = “unitrix”:包名,在 crates.io 上必须唯一

  • version = “0.0.4”:当前版本号

  • description:项目描述,说明这是一个支持编译时/运行时的物理单位管理和2D矩阵变换库,特别适合科学计算且支持 no_std 环境

  1. 技术规格:
  • edition = “2024”:使用 Rust 2024 版

  • rust-version = “1.86.0”:最低支持的 Rust 编译器版本

  1. 作者与文档:
  • 作者信息(liuyuan)

  • 自动生成的文档链接(docs.rs)

  • GitHub 仓库地址

  • README 文件路径

  1. 分类信息:
  • keywords:包含 “unitrix”、“SI”(国际单位制)、“units”、“no_std” 等关键词

  • categories:属于 no-std(无标准库)、science(科学计算)、value-formatting(值格式化)类别

  1. 许可:
  • 双许可(MIT 或 Apache-2.0),使用 SPDX 标识符
  1. 特性配置:
  • [features] 部分定义了一个 std 特性(默认为 no_std 环境,启用 std 特性可获取标准库支持)

这个配置显示 unitrix 是一个专注于科学计算、物理单位管理和矩阵运算的基础库,特别注重在嵌入式等无标准库环境中的使用。