Crates.io | kkbt |
lib.rs | kkbt |
version | 0.1.3 |
source | src |
created_at | 2022-04-19 00:26:04.72313 |
updated_at | 2022-12-26 03:57:07.165286 |
description | A minilib. |
homepage | |
repository | https://gitee.com/kkbt/rust-kkbt |
max_upload_size | |
id | 570095 |
size | 10,005 |
恐咖兵糖的常用工具库。
小型工具库,恐咖兵糖常用工具的集合
Common Tools for 恐咖兵糖
Gitee https://gitee.com/kkbt/rust-kkbt
函数:
show_file_hex(path:&str);
Shabby KV
Maybe it can use for config file.
use kkbt::SKV;
fn main() {
// SKV::init("data/index", "data/data").unwrap();
let skv = SKV::config("data/index", "data/data");
skv.set("kkbt", Vec::from("我是恐咖兵糖1".as_bytes()));
skv.set("kkbt", Vec::from("".as_bytes()));
assert_eq!(skv.get_utf8("kkbt"),None);
skv.set("kkbt", Vec::from("我是恐咖兵糖3".as_bytes()));
assert_eq!(skv.get_utf8("kkbt"),Some("我是恐咖兵糖3".to_string()));
assert_eq!(skv.get_utf8("abcdefg"),None);
// kkbt::show_file_hex("data/index", 3).unwrap();
}