pub struct Walker { /* private fields */ }Expand description
Parallel, gitignore-aware file walker.
§Example
use mati_core::analysis::Walker;
let walker = Walker::new("/path/to/repo");
// Streaming — parser can consume while walk is still in progress.
for file in walker.walk_channel().unwrap() {
println!("{} ({:?})", file.rel_path, file.language);
}
// Batch — sorted Vec, useful when you need the full set before proceeding.
let files = walker.walk().unwrap();Implementations§
Source§impl Walker
impl Walker
Sourcepub fn new(root: impl Into<PathBuf>) -> Self
pub fn new(root: impl Into<PathBuf>) -> Self
Create a walker rooted at root with default settings.
Sourcepub fn max_file_size(self, bytes: u64) -> Self
pub fn max_file_size(self, bytes: u64) -> Self
Override the maximum file size. Files larger than bytes are skipped.
Sourcepub fn follow_symlinks(self, yes: bool) -> Self
pub fn follow_symlinks(self, yes: bool) -> Self
Whether to follow symbolic links. Default: false (avoids cycles).
Sourcepub fn walk_channel(&self) -> Result<Receiver<WalkedFile>>
pub fn walk_channel(&self) -> Result<Receiver<WalkedFile>>
Primary interface: start the walk and return a channel receiver.
The walk runs on a background thread; the caller can begin consuming
WalkedFile items immediately while traversal is still in progress.
The channel closes automatically when the walk finishes.
Returns Err if root is not an accessible directory.
Sourcepub fn walk(&self) -> Result<Vec<WalkedFile>>
pub fn walk(&self) -> Result<Vec<WalkedFile>>
Batch interface: collect the full walk into a sorted Vec.
Useful for callers that need the complete file list before proceeding
(tests, dep parsing, one-shot reporting). Prefer walk_channel when
results will be piped into a parallel processing stage.
Auto Trait Implementations§
impl Freeze for Walker
impl RefUnwindSafe for Walker
impl Send for Walker
impl Sync for Walker
impl Unpin for Walker
impl UnsafeUnpin for Walker
impl UnwindSafe for Walker
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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