pub struct FileWalker { /* private fields */ }Expand description
Walks a directory tree and collects files eligible for scanning.
Implementations§
Source§impl FileWalker
impl FileWalker
Sourcepub fn new(config: &ScanConfig) -> Result<Self>
pub fn new(config: &ScanConfig) -> Result<Self>
Build a new walker from a ScanConfig.
§Errors
Returns CodemodError::Scan if the target directory does not exist
or a glob pattern is invalid.
Sourcepub fn collect_files(
&self,
language: &dyn LanguageAdapter,
) -> Result<Vec<PathBuf>>
pub fn collect_files( &self, language: &dyn LanguageAdapter, ) -> Result<Vec<PathBuf>>
Collect all files under the target directory that:
- Have an extension supported by the language adapter
- Match the include patterns (if any)
- Do not match the exclude patterns
- Are not ignored by
.gitignore(if configured) - Are smaller than
max_file_size
Auto Trait Implementations§
impl Freeze for FileWalker
impl RefUnwindSafe for FileWalker
impl Send for FileWalker
impl Sync for FileWalker
impl Unpin for FileWalker
impl UnsafeUnpin for FileWalker
impl UnwindSafe for FileWalker
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more