pub struct TreeOptions {
pub case_sensitive: bool,
pub respect_gitignore: bool,
pub depth: Option<usize>,
pub omit_path_prefix: Option<PathBuf>,
}Expand description
Configuration options for directory tree operations.
Fields§
§case_sensitive: boolWhether file path matching should be case sensitive
respect_gitignore: boolWhether to respect .gitignore files when determining which files to include
depth: Option<usize>Maximum depth of directory traversal (number of directory levels to explore)
omit_path_prefix: Option<PathBuf>Optional path prefix to remove from directory paths in tree results.
When set to Some(path), this prefix will be removed from the beginning of each directory path in the results.
If a directory path doesn’t start with this prefix, it will be left unchanged.
When set to None (default), directory paths are returned as-is.
This is useful when you want to display relative paths instead of full paths in results, or when you want to normalize paths for consistency.
§Examples
omit_path_prefix: Some(PathBuf::from("/home/user/projects/myrepo"))will transform a directory path like/home/user/projects/myrepo/src/utiltosrc/utilin the resultsomit_path_prefix: Nonewill leave all directory paths unchanged
Trait Implementations§
Source§impl Clone for TreeOptions
impl Clone for TreeOptions
Source§fn clone(&self) -> TreeOptions
fn clone(&self) -> TreeOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TreeOptions
impl Debug for TreeOptions
Auto Trait Implementations§
impl Freeze for TreeOptions
impl RefUnwindSafe for TreeOptions
impl Send for TreeOptions
impl Sync for TreeOptions
impl Unpin for TreeOptions
impl UnwindSafe for TreeOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more