11 releases
new 0.5.10 | Feb 19, 2025 |
---|---|
0.5.9 | Feb 19, 2025 |
#3 in #个人使用的rust工具库
568 downloads per month
Used in wang-utils
9KB
248 lines
个人使用的rust工具库
主要用于简化rust开发
Feature整理
该库拆分成了多个feature,默认情况下会引用部分feature,如需其他非默认的请自行添加
名称 | 是否默认 | 简介 |
---|---|---|
full | 包含全部feature | |
core | √ | 标准库通用工具 |
logger | √ | 日志相关工具 |
command | 命令行相关工具 | |
map | map相关工具 | |
git | git相关工具 | |
json | √ | json相关工具 |
lib.rs
:
map相关工具
示例
use std::collections::HashMap;
use wang_utils_map::HashmapCustom;
let mut map = HashMap::new();
map.set_value("i32", 111);
map.set_value("String", "111".to_string());
let option = map.get_value::<i32>("i32");
assert_eq!(Some(111), option);
let option1 = map.get_value_ref::<String>("String");
assert_eq!(Some(&"111".to_string()), option1);
Dependencies
~0.3–0.9MB
~20K SLoC