#array #const #auto

auto-const-array

定义不指定长度的const数组

4个版本

0.2.1 2023年7月11日
0.2.0 2022年11月22日
0.1.1 2022年11月22日
0.1.0 2022年11月22日

#1539 in Proc宏

Download history · Rust 包仓库 584/week @ 2024-03-13 · Rust 包仓库 896/week @ 2024-03-20 · Rust 包仓库 1359/week @ 2024-03-27 · Rust 包仓库 873/week @ 2024-04-03 · Rust 包仓库 732/week @ 2024-04-10 · Rust 包仓库 322/week @ 2024-04-17 · Rust 包仓库 793/week @ 2024-04-24 · Rust 包仓库 627/week @ 2024-05-01 · Rust 包仓库 837/week @ 2024-05-08 · Rust 包仓库 527/week @ 2024-05-15 · Rust 包仓库 564/week @ 2024-05-22 · Rust 包仓库 572/week @ 2024-05-29 · Rust 包仓库 945/week @ 2024-06-05 · Rust 包仓库 516/week @ 2024-06-12 · Rust 包仓库 295/week @ 2024-06-19 · Rust 包仓库 473/week @ 2024-06-26 · Rust 包仓库

2,295 每月下载量
26 个crate中(通过 monoio)使用

MIT/Apache

8KB
131

Auto Const Array

使用此宏来声明一个不指定长度的const数组。

Crates.io MIT/Apache-2 licensed

use auto_const_array::auto_const_array;
auto_const_array! {
    // Additional attributes and docs are supported.
    /// Common array with public visibility.
    #[allow(unused)]
    pub const ARRAY_COMMON: [u8; _] = [1, 2, 4];
    /// Special array with cfg conditional compling.
    const ARRAY_WITH_ATTR: [u8; _] = [1, #[cfg(unix)] 2]
}

依赖

~310–770KB
~18K SLoC