dev_tool/
lib.rs

1//! dev-tool 是一个Rust工具包类库,对配置读取、文件操作、加解密、转码、正则、线程等方法进行封装,自定义或集成各种Util工具类。 
2//! 
3//! Yaml 配置读取
4//! ```rust
5//! use dev_tool::YamlWrapper;
6//! 
7//! #[test]
8//! fn test_config_util() {
9//!    // 读取配置文件
10//!     let wrapper = YamlWrapper::new("docs/config.yaml").unwrap();
11//!     // 直接将yaml字符串转换成YamlWrapper
12//!     // let warpper = YamlWrapper::from_string("......").unwrap();
13//! 
14//!     // 不管是对象,还是数组,都是直接通过`.`操作。address是对象,children是数组,name是children中对象的一个属性
15//!     let x = wrapper.get("address.children.name");
16//!     println!("address.children.name = {:?}", x);
17//!     
18//!     // get方法是获取数组,而get_one获取的是第一个元素
19//!     let x = wrapper.get_one("address.x.y").as_str().unwrap();
20//!     println!("address.x.y = {}", x);
21//! }
22//! ```
23//! 
24mod conf_util;
25mod conf_util_yaml;
26mod date_util;
27mod file_util;
28mod hex_util;
29mod http_util;
30mod io_util;
31mod log_util;
32mod mysql_util;
33mod re_util;
34mod secure_util;
35mod thread_util;
36mod id_util;
37mod str_util;
38mod collection_util;
39pub mod sqlite_util;
40
41pub use date_util::DateUtil;
42pub use hex_util::HexUtil;
43pub use file_util::FileUtil;
44pub use re_util::ReUtil;
45pub use secure_util::SecureUtil;
46pub use id_util::IdUtil;
47pub use str_util::StrUtil;
48pub use conf_util::JsonWrapper;
49pub use conf_util_yaml::YamlWrapper;
50pub use collection_util::CollectionUtil;
51