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.44.1 |
anyhow | github | 1.0.97 |
once_cell | github | 1.21.1 |
serde | github | 1.0.219 |
serde_json | github | 1.0.140 |
log | github | 0.4.26 |
async-trait | github | 0.1.88 |
async-recursion | github | 1.1.1 |
parking_lot | github | 0.12.3 |
fastdate | github | 0.3.34 |
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.1.2", = ["serde_derive_json"] }
main.rs file :
use FromJson;
use ToJson;
use ;
option macro example
Cargo.toml file :
= { = "2.1.2", = ["macro", "anyhow"] }
main.rs file :
use anyhow;
root_path example
Cargo.toml file:
= { = "2.1.2", = ["root_path"] }
main.rs file: