Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"files.associations": {
"*.rs.j2": "rust",
},
"rust-analyzer.cargo.features": ["serial"],
"rust-analyzer.cargo.features": ["serial", "parallel", "async"],
"rust-analyzer.files.exclude": [
"templates"
]
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "easy_fuser"
version = "0.4.5"
version = "0.5.0"
edition = "2024"
description = "A flexible and idiomatic Fuse implementation for Rust"
license = "MIT"
Expand All @@ -18,6 +18,7 @@ libfuse = ["fuser/libfuse"]

[dependencies]
# Core dependencies
easy_fuser_macro = { version = "0.1", path = "easy_fuser_macro"}
fuser = { version = "0.16.0" }
log = "0.4"
libc = "0.2"
Expand Down
20 changes: 17 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,18 @@ fn main() -> std::io::Result<()> {

let out_dir = env::var_os("OUT_DIR").expect("OUT_DIR not set");

for mode in [Modes::Serial, Modes::Parallel] {
let mut modes = vec![];
if env::var("CARGO_FEATURE_SERIAL").is_ok() {
modes.push(Modes::Serial);
}
if env::var("CARGO_FEATURE_PARALLEL").is_ok() {
modes.push(Modes::Parallel);
}
if env::var("CARGO_FEATURE_ASYNC").is_ok() {
modes.push(Modes::Async);
}

for mode in modes {
let mode = mode.as_str();
let mode_dir = Path::new(&out_dir).join(mode);
fs::create_dir_all(&mode_dir)?;
Expand All @@ -47,8 +58,11 @@ fn main() -> std::io::Result<()> {
let content = FuseHandlerTemplate { mode }.render()?;
fs::write(mode_dir.join("fuse_handler.rs"), content)?;

let content = MoutingTemplate { mode }.render()?;
fs::write(mode_dir.join("mouting.rs"), content)?;
let content = MountingTemplate { mode }.render()?;
fs::write(mode_dir.join("mounting.rs"), content)?;

let content = FuseLibTemplate { mode }.render()?;
fs::write(mode_dir.join("fuse_lib.rs"), content)?;
}

Ok(())
Expand Down
13 changes: 13 additions & 0 deletions easy_fuser_macro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "easy_fuser_macro"
version = "0.1.0"
edition = "2024"

[lib]
proc-macro = true

[dependencies]
syn = {version = "2.0", features = [ "full" ] }
quote = "1.0"
proc-macro2 = "1.0"
either = "1.15.0"
Loading