from_dir!() { /* proc-macro */ }Expand description
Convert from folder to module
§Grammar
// use
from_dir!($module)
// $module
$vis mod $ident from $path {
$($filter;)*
}
// $filter (text)
text $file_filter
// $filter (binary)
binary $file_filter
// $file_filter
[$(include [$($path),*] exclude [$($path),*]),*]§Example
from_dir!(mod assets from "../rc" {
text [include ["lang/*.toml"] exclude []];
binary [include ["images/*.png"] exclude []];
});
println!("en-US.toml: {}", assets::lang::en_US);
println!("zh-CN.toml: {}", assets::lang::zh_CN);