跳到技能内容
词映 AI导航
发现工具选型指南Skills 技能AI 快讯AI图片AI视频AI文档AI办公AI助手AI搜索AI编程AI音频AI设计AI智能体模型与开发AI学习模型评测AI提示词内容检测AI金融AI 3D扫描与识别其他工具跨境电商 AI
词映 AI导航
工具库Skills 技能
我的收藏
词映 AI导航
发现工具选型指南Skills 技能AI 快讯AI图片AI视频AI文档AI办公AI助手AI搜索AI编程AI音频AI设计AI智能体模型与开发AI学习模型评测AI提示词内容检测AI金融AI 3D扫描与识别其他工具跨境电商 AI
Skills directory/huiali/rust-skills/rust-const

Codex Rust Const Generics for Fixed-Size Buffers

Represent an array length in its type and verify that callers observe the intended size contract.

中文

Install in Codex

Codex, a Rust project and Cargo toolchain. The example uses small safe arrays.

  1. Copy the pinned `skills/rust-const/` directory into `.agents/skills/rust-const/` in the project.
  2. Select `$rust-const` and identify the length invariant for the change.

Example task

In a practice crate, model buffers for four or eight item identifiers. Test a function that accepts only the four-item buffer.

What to check

The sizes are visible in the types, and the compile check rejects an eight-item buffer at the four-item call site.

Original SKILL.md on GitHub · Updated 2026-11-13

Frequently asked question

Should every collection use const generics?

Use a compile-time size when it is part of the contract. Keep runtime sizes dynamic.

Related skills from this repository

  • Codex Model Missing Values and Parse Failures in Rust
Browse Codex skills in the Chinese directory
词映 AI 导航Skills 技能
工具分类全部工具已本地化技能选型指南AI 快讯