cbsk_base is a locked version cargo crates
you can use cbsk_base lock commonly used cargo crates versions
cbsk_base also supports some custom trait, like ToJson,FromJson and some macro
now locked version
name | git | version |
---|---|---|
tokio | github | 1.40.0 |
anyhow | github | 1.0.87 |
once_cell | github | 1.19.0 |
serde | github | 1.0.210 |
serde_json | github | 1.0.128 |
log | github | 0.4.22 |
async-trait | github | 0.1.82 |
async-recursion | github | 1.1.1 |
parking_lot | github | 0.12.3 |
fastdate | github | 0.3.33 |
serde example
use serde_derive_json,
the struct impl Serialize, will auto impl ToJson
the struct impl Deserialize, will auto impl FromJson
Cargo.toml file :
= { = "2.0.3", = ["serde_derive_json"] }
main.rs file :
use FromJson;
use ToJson;
use ;
option macro example
Cargo.toml file :
= { = "2.0.3", = ["macro", "anyhow"] }
main.rs file :
use anyhow;
root_path example
Cargo.toml file:
= { = "2.0.3", = ["root_path"] }
main.rs file: