#macro #fundamental #general-purpose #index #class #component #comprehension

无 std impls_index

提供多个宏,将每个函数放入一个命名宏中,以索引类中的每个函数。

10 个版本 (6 个重大更新)

0.7.0 2024年5月11日
0.6.0 2024年3月16日
0.5.0 2024年3月16日
0.2.0 2023年10月19日
0.1.3 2022年7月2日

#1538开发工具

Download history • Rust 包仓库 582/week @ 2024-04-29 • Rust 包仓库 1201/week @ 2024-05-06 • Rust 包仓库 1418/week @ 2024-05-13 • Rust 包仓库 603/week @ 2024-05-20 • Rust 包仓库 1344/week @ 2024-05-27 • Rust 包仓库 699/week @ 2024-06-03 • Rust 包仓库 437/week @ 2024-06-10 • Rust 包仓库 437/week @ 2024-06-17 • Rust 包仓库 392/week @ 2024-06-24 • Rust 包仓库 350/week @ 2024-07-01 • Rust 包仓库 216/week @ 2024-07-08 • Rust 包仓库 619/week @ 2024-07-15 • Rust 包仓库 383/week @ 2024-07-22 • Rust 包仓库 392/week @ 2024-07-29 • Rust 包仓库 224/week @ 2024-08-05 • Rust 包仓库 476/week @ 2024-08-12 • Rust 包仓库

每月下载量 1,531
用于 94 个包 (直接使用 6 个)

MIT 许可证

20KB
625 代码行

模块 :: impls_index

experimental rust-status docs.rs Open in Gitpod discord

提供多个宏,将每个函数放入一个命名宏中,以索引类中的每个函数。

鼓励编写更好的代码,组件索引去除了实现细节,这对于理解代码和看清大局非常重要。

基本用例

use ::impls_index::*;

impls1!
{
  fn f1() -> i32
  {
    println!( "f1() : 13" );
    13
  }
};

index!
{
  f1,
}

assert_eq!( f1(), 13 );
/* print : f1() : 13 */

添加到您的项目中

cargo add impls_index_meta

从仓库尝试

git clone https://github.com/Wandalen/wTools
cd wTools
cd examples/impls_index_trivial
cargo run

依赖项

~0.5–1MB
~21K SLoC