Module utils

Module utils 

Source
Expand description

Utility functions and shared types used across the crate.

This module contains localization message structures, logging helpers, translation loading, file comparison helpers and the core incremental copying implementation. Public items are documented with examples where relevant.

Structs§

ExcludeMatcher
Pattern matcher for exclude lists.
Messages
Localizable messages loaded from assets/translations.json.

Functions§

build_exclude_matcher
Build an ExcludeMatcher from a list of glob patterns.
clear_terminal
Clear the entire terminal screen.
copy_incremental
Perform an incremental copy from src_dir to dest_dir.
create_logger
Create an optional logger for the provided path.
is_newer
Return true if src is newer than dest (based on filesystem modification time).
load_translations
Load the embedded translations JSON and deserialize it.

Type Aliases§

Logger
Thread-safe file logger type: Arc<Mutex<BufWriter<File>>>.
Translations
Type alias for the translations map loaded from JSON.