code rewritted to modules; add local/server flags to build

This commit is contained in:
2026-09-19 15:10:01 +03:00
parent 1015949c15
commit 49d8ae7b7f
15 changed files with 534 additions and 545 deletions

17
build.rs Normal file
View File

@ -0,0 +1,17 @@
fn main() {
println!("cargo:rerun-if-env-changed=LOCAL");
println!("cargo:rustc-check-cfg=cfg(local)");
let local_env = std::env::var("LOCAL")
.map(|v| {
let v = v.trim().to_ascii_lowercase();
matches!(v.as_str(), "true" | "1" | "yes" | "on")
})
.unwrap_or(false);
let local_feature = std::env::var("CARGO_FEATURE_LOCAL").is_ok();
if local_env || local_feature {
println!("cargo:rustc-cfg=local");
}
}