fast_fs/lib.rs
1// <FILE>crates/fast-fs/src/lib.rs</FILE> - <DESC>Entry point re-exporting OFPF modules</DESC>
2// <VERS>VERSION: 0.10.0</VERS>
3// <WCTX>Preparing for crates.io release</WCTX>
4// <CLOG>Added missing_docs lint, improved crate-level documentation</CLOG>
5
6#![deny(missing_docs)]
7#![deny(rustdoc::broken_intra_doc_links)]
8
9//! High-speed async file system traversal and navigation library.
10//!
11//! `fast-fs` provides two main capabilities:
12//!
13//! 1. **Directory Reading Functions** - Simple async functions for traversing directories
14//! 2. **Navigation Module ([`nav`])** - A batteries-included file browser state machine
15//!
16//! # Quick Start
17//!
18//! ```no_run
19//! use fast_fs::{read_dir, read_dir_recursive, TraversalOptions};
20//!
21//! # async fn example() -> Result<(), fast_fs::Error> {
22//! // Read a single directory
23//! let files = read_dir("/path/to/dir").await?;
24//!
25//! // Recursive with options
26//! let options = TraversalOptions::default()
27//! .with_max_depth(3)
28//! .with_extensions(&["rs", "toml"]);
29//! let all_files = read_dir_recursive("/project", options).await?;
30//!
31//! for file in all_files {
32//! println!("{}: {} bytes", file.name, file.size);
33//! }
34//! # Ok(())
35//! # }
36//! ```
37//!
38//! # File Browser Component
39//!
40//! For building file pickers, save dialogs, and project explorers, see the [`nav`] module:
41//!
42//! ```no_run
43//! use fast_fs::nav::{Browser, BrowserConfig, KeyInput, ActionResult};
44//!
45//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
46//! let config = BrowserConfig::open_dialog();
47//! let mut browser = Browser::new(config).await?;
48//!
49//! // Handle key input
50//! match browser.handle_key(KeyInput::Down).await {
51//! ActionResult::Done => { /* re-render */ }
52//! ActionResult::FileSelected(path) => println!("Selected: {}", path.display()),
53//! _ => {}
54//! }
55//! # Ok(())
56//! # }
57//! ```
58//!
59//! # Feature Highlights
60//!
61//! - **Async I/O** - Non-blocking traversal using tokio
62//! - **Streaming API** - Memory-efficient traversal with backpressure
63//! - **Gitignore Support** - Built-in `.gitignore` and `.ignore` pattern matching
64//! - **Vim-style Navigation** - Configurable key bindings
65//! - **Multi-Selection** - Range selection with Shift+Arrow
66//! - **Framework-Agnostic** - You handle rendering, we handle state
67mod error;
68pub mod filter;
69mod functions;
70pub mod models;
71pub mod nav;
72pub mod reader;
73// Re-export domain types
74pub use error::Error;
75pub use filter::cls_gitignore_matcher::GitignoreMatcher;
76pub use models::cls_file_entry::FileEntry;
77pub use models::cls_file_list::FileList;
78pub use models::cls_sort_by::SortBy;
79pub use models::cls_traversal_options::TraversalOptions;
80// Re-export functions (Flattened API)
81pub use functions::fnc_is_ignored::is_ignored;
82pub use reader::fnc_read_dir::read_dir;
83pub use reader::fnc_read_dir_recursive::read_dir_recursive;
84pub use reader::fnc_read_dir_stream::read_dir_stream;
85pub use reader::fnc_read_dir_visible::read_dir_visible;
86/// Result type for fast-fs operations
87pub type Result<T> = std::result::Result<T, Error>;
88
89// <FILE>crates/fast-fs/src/lib.rs</FILE>
90// <VERS>END OF VERSION: 0.9.0</VERS>