1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// <FILE>crates/fast-fs/src/reader/fnc_read_dir_stream.rs</FILE> - <DESC>Streaming directory traversal with backpressure support</DESC>
// <VERS>VERSION: 1.1.1</VERS>
// <WCTX>Fixing doc tests to use no_run instead of ignore</WCTX>
// <CLOG>Changed doc example from ignore to no_run with proper async wrapper</CLOG>
use crateGitignoreMatcher;
use crate::;
use ;
use Path;
use StreamState;
/// Stream directory entries with filtering and backpressure support
///
/// This function returns a stream that yields entries as they are discovered,
/// allowing for memory-efficient traversal of large directory trees. The stream
/// respects backpressure, so slow consumers won't cause unbounded memory growth.
///
/// # Arguments
///
/// * `path` - Root directory to traverse
/// * `options` - Traversal options (filtering, depth, etc.)
///
/// # Returns
///
/// A stream of `Result<FileEntry, Error>` that yields entries as they are discovered
///
/// # Examples
///
/// ```no_run
/// # async fn example() {
/// use fast_fs::{read_dir_stream, TraversalOptions};
/// use futures::StreamExt;
///
/// let options = TraversalOptions::default()
/// .with_gitignore(true)
/// .with_max_depth(5);
///
/// let mut stream = Box::pin(read_dir_stream(".", options));
/// while let Some(entry) = stream.next().await {
/// match entry {
/// Ok(file) => println!("{}", file.path.display()),
/// Err(e) => eprintln!("Error: {}", e),
/// }
/// }
/// # }
/// ```
// <FILE>crates/fast-fs/src/reader/fnc_read_dir_stream.rs</FILE>
// <VERS>END OF VERSION: 1.1.0</VERS>