macro_rules! stem_filter {
($vis:vis $name:ident, $base_name:literal) => { ... };
}Expand description
Creates a Filter type that only allows files / folders with a specific stem.
ยงExamples
use std::path::Path;
use dir_structure::dir_children::Filter;
dir_structure::stem_filter!(MainFile, "main");
assert!(MainFile::allows(Path::new("main.rs")));
assert!(MainFile::allows(Path::new("src/a/b/main.rs")));
assert!(MainFile::allows(Path::new("main.txt")));
assert!(!MainFile::allows(Path::new("main.a.rs")));