Crate nar_dev_utils

Source
Expand description

一些实用工具、定义、函数

  • 📌宏定义专门放在[macros.rs]中
    • 📄参考标准库与其它包(如winnow

Macros§

asserts
用于简化「连续判断相等」的宏
catch_flow
用于将「流式追加」捕捉转换成「固定返回值」
debug_eprint
eprint @ 调试阶段(stderr)
debug_eprintln
eprintln @ 调试阶段(stderr)
debug_print
print @ 调试阶段
debug_println
println @ 调试阶段
f_parallel
平行将参数填充进函数
f_tensor
更通用的「函数参数张量展开」宏
fail_tests
辅助用测试宏/批量添加失败测试
feature_pub_mod_and_reexport
批量封装:在限定的特性(feature)下,导入并重新导出模块
first
first!:匹配首个判据,并返回其值
for_in_ifs
for-in-if格式
if_return
简化「if 条件 {return 值;}」的控制流
ifs
ifs!:依次匹配并执行
impl_once
一次性特征结构
list
列表推导式
macro_once
立即宏
manipulate
manipulate!
matches_or
匹配某个值,或返回另一个值
mod_and_pub_use
批量封装:导入并重新导出模块
mods
批量封装:在限定的特性(feature)下,导入并重新导出模块
pipe
pipe!
pub_mod_and_pub_use
批量封装:导入并重新导出模块
push_str
用于简化「连续追加字符串」的宏
show
show!:复现Julia的@show
unwrap_or_return
解包或返回

Functions§

linear_search
linear_search_by
【默认方法】线性查找(使用「判据函数」比对大小)