feat: define Ctx to hold context (e.g. fs and net handles)

This commit is contained in:
Paul Campbell 2024-11-29 14:31:40 +00:00
parent 90aa89d37a
commit a820719266
2 changed files with 19 additions and 2 deletions

View file

@ -14,8 +14,8 @@ color-eyre = "0.6"
# "display", # "display",
# "from", # "from",
#] } #] }
#kxio = {path = "../kxio/"} kxio = {path = "../kxio/"}
## kxio = "3.1" # kxio = "3.1"
#serde = { version = "1.0", features = ["derive"] } #serde = { version = "1.0", features = ["derive"] }
#serde_json = "1.0" #serde_json = "1.0"
tokio = { version = "1.41", features = ["full"] } tokio = { version = "1.41", features = ["full"] }

View file

@ -1 +1,18 @@
//
use std::path::PathBuf;
use kxio::{fs::FileSystem, net::Net};
#[derive(Clone)]
pub struct Ctx {
pub fs: FileSystem,
pub net: Net,
}
impl Default for Ctx {
fn default() -> Self {
Self {
fs: kxio::fs::new(PathBuf::default()),
net: kxio::net::new(),
}
}
}