Crate xvc_walker
source ·Expand description
Xvc walker traverses directory trees with ignore rules.
Ignore rules are similar to .gitignore and child directories are not traversed if ignored.
walk_parallel function is the most useful element in this module. It walks and sends PathMetadata through a channel, also updating the ignore rules and sending them.
Re-exports
pub use abspath::AbsolutePath;pub use error::Error;pub use error::Result;pub use sync::PathSync;pub use sync::PathSyncSingleton;pub use globset;
Modules
- An absolute path type to ensure that we don’t use relative paths.
- Error codes and messages for Xvc Walker
- A libnotify based file system notification module that considers ignore rules.
- This module contains PathSync structure to synchronize operations on paths.
Structs
- Glob represents a successfully parsed shell glob pattern.
- GlobSet represents a group of globs that can be matched together in a single pass.
- GlobSetBuilder builds a group of patterns that can be used to simultaneously match a file path.
- Complete set of ignore rules for a directory and its child directories.
- Combine a path and its metadata in a single struct
- Pattern is generic and could be an instance of String, Glob, Regex or any other object. The type is evolved by compiling. A pattern can start its life as
Pattern<String>and can be compiled intoPattern<Glob>orPattern<Regex>. - What’s the ignore file name and should we add directories to the result?
Enums
- Show whether a path matches to a glob rule
- Is the path only a directory, or could it be directory or file?
- Is this pattern a ignore or whitelist patter?
- Is the pattern matches anywhere or only relative to a directory?
- Do we get this pattern from a file (.gitignore, .xvcignore, …) or specify it directly in code?
Traits
- A hashable type.
Functions
- Just build the ignore rules with the given directory
- Check whether
pathis whitelisted or ignored withignore_rules - convert a set of rules in
contentto glob patterns. patterns may come fromsource. the root directory of all search is inignore_root. - Return all childs of a directory regardless of any ignore rules If there is an error to obtain the metadata, error is added to the element instead
- merge ignore rules in a single set of ignore rules.
- Walk all child paths under
dirand send non-ignored paths topath_sender. Newly found ignore rules are sent throughignore_sender. The ignore file name (.xvcignore,.gitignore,.ignore, …) is set bywalk_options. - Walk
dirwithwalk_options, with the given initialignore_rules. Note that ignore rules are expanded with the rules given in theignore_filenameinwalk_options. The result is added to givenres_pathsto reduce the number of memory inits for vec.
Derive Macros
- Derive macro generating an impl of the trait
Hash.