Crate tooka_core

Source
Expand description

§Tooka Core

githubcrates-iodocs-rs

The internal rule engine for tooka, a powerful CLI for organizing files using declarative YAML rules.


§Overview

tooka-core exposes the core components that enable the Tooka CLI to:

  • Load and validate YAML-based rule files
  • Recursively traverse directories in parallel
  • Apply conditional filters based on metadata, timestamps, and more
  • Perform actions like move, rename, copy, delete, or skip

It’s designed for reusability, making it easy to embed file-handling automation into other Rust apps.


See the full source and CLI wrapper:
github.com/Benji377/tooka

Modules§

context
Core application context for Tooka.
error
Error definitions for Tooka.
file_match
File matching utilities for Tooka.
file_ops
Module handling file operations such as moving, copying, renaming, and deleting files. Supports dry run mode to simulate actions without making changes to the filesystem. Provides utilities for computing destination paths with optional preservation of directory structure, and uses metadata extraction to support renaming templates.
logger
Logging utilities for the Tooka application.
report
Report generation module for Tooka.
rule
Defines the core data structures representing file operation rules in Tooka. Includes rule conditions, actions, and validation logic ensuring rule correctness. Supports complex matching criteria such as filename patterns, metadata, size, dates, etc.
rules_file
Provides the RulesFile struct representing the rules.yaml configuration file and methods to load, save, add, remove, find, export, list, and toggle rules. Handles reading from and writing to disk, rule validation, and rule management within Tooka’s file operation rules system.
sorter
File sorting logic for the Tooka application.
template

Structs§

Config
Represents the user configuration for Tooka.