Crate fast_fs

Crate fast_fs 

Source
Expand description

High-speed async file system traversal and navigation library.

fast-fs provides two main capabilities:

  1. Directory Reading Functions - Simple async functions for traversing directories
  2. Navigation Module (nav) - A batteries-included file browser state machine

§Quick Start

use fast_fs::{read_dir, read_dir_recursive, TraversalOptions};

// Read a single directory
let files = read_dir("/path/to/dir").await?;

// Recursive with options
let options = TraversalOptions::default()
    .with_max_depth(3)
    .with_extensions(&["rs", "toml"]);
let all_files = read_dir_recursive("/project", options).await?;

for file in all_files {
    println!("{}: {} bytes", file.name, file.size);
}

§File Browser Component

For building file pickers, save dialogs, and project explorers, see the nav module:

use fast_fs::nav::{Browser, BrowserConfig, KeyInput, ActionResult};

let config = BrowserConfig::open_dialog();
let mut browser = Browser::new(config).await?;

// Handle key input
match browser.handle_key(KeyInput::Down).await {
    ActionResult::Done => { /* re-render */ }
    ActionResult::FileSelected(path) => println!("Selected: {}", path.display()),
    _ => {}
}

§Feature Highlights

  • Async I/O - Non-blocking traversal using tokio
  • Streaming API - Memory-efficient traversal with backpressure
  • Gitignore Support - Built-in .gitignore and .ignore pattern matching
  • Vim-style Navigation - Configurable key bindings
  • Multi-Selection - Range selection with Shift+Arrow
  • Framework-Agnostic - You handle rendering, we handle state

Re-exports§

pub use filter::cls_gitignore_matcher::GitignoreMatcher;
pub use models::cls_file_entry::FileEntry;
pub use models::cls_file_list::FileList;
pub use models::cls_sort_by::SortBy;
pub use models::cls_traversal_options::TraversalOptions;
pub use reader::fnc_read_dir::read_dir;
pub use reader::fnc_read_dir_recursive::read_dir_recursive;
pub use reader::fnc_read_dir_stream::read_dir_stream;
pub use reader::fnc_read_dir_visible::read_dir_visible;

Modules§

filter
Gitignore pattern matching and file filtering.
models
Core data types for file system operations.
nav
Navigation module for file browsing
reader
Async directory reading functions.

Enums§

Error
Error type for fast-fs operations

Functions§

is_ignored
Check if a path would be ignored by gitignore patterns at the given root

Type Aliases§

Result
Result type for fast-fs operations