Fn

Function Fn 

Source
pub fn Fn(_: &Struct) -> Type
Expand description

Generates a list of file paths from the specified root directory, excluding paths that match any of the specified exclude patterns.

§Argument

  • Option - A reference to an Option struct containing the following fields:
    • Exclude: A vector of strings representing patterns to exclude.
    • Root: The root directory to start the walk from.
    • Separator: The separator used for splitting file paths.

§Returns

Returns a vector of vectors, where each inner vector contains the components of a file path split by the specified separator.

§Panics

This function will panic if it encounters an error while reading a directory entry.

§Example

let options = Option {
	Exclude:vec!["node_modules".to_string(), "target".to_string()],
	Root:".".to_string(),
	Separator:'/',
};
let paths = Fn(&options);
for path in paths {
	println!("{:?}", path);
}