Skip to main content

Crate rusty_detox

Crate rusty_detox 

Source
Expand description

§rusty-detox

A Rust port of Doug Harple’s detox(1) v3.0.1: sanitize messy filenames through a configurable filter pipeline.

§Quick start

use rusty_detox::{DetoxBuilder, Sequence};

let detox = DetoxBuilder::new()
    .sequence(Sequence::utf_8())
    .build();
let clean = detox.sanitize("My Résumé (final v2).pdf");
// The closing paren before `.pdf` becomes `_`; trailing-trim only
// strips runs at the very ends of the basename, not before the extension.
assert_eq!(clean, "My_Resume_final_v2_.pdf");

§Stability (lockstep SemVer)

Library and binary share a single crate version. The vendored upstream translation tables (Table.utf_8, Table.iso8859_1) are frozen at v3.0.1 — re-vendoring is a MAJOR semver bump.

Re-exports§

pub use error::DetoxError;
pub use filter::Filter;
pub use sequence::Sequence;

Modules§

config
detoxrc config-file parser (FR-009/FR-010/FR-011, AD-010, US6).
error
Public error type for the rusty-detox library API (FR-042).
filter
The Filter pipeline (FR-001..FR-007 + FR-039).
planner
Rename planner (FR-023/FR-024, AD-011, SC-029).
renamer
Atomic rename with EXDEV cross-device fallback (FR-025/FR-030, HINT-003).
sequence
Sequence — ordered list of Filters applied left-to-right (FR-008/FR-038).
tables
Vendored translation tables from upstream dharple/detox v3.0.1 (HINT-001).
walker
Recursive directory walker (FR-026/FR-027/FR-028, AD-014, HINT-002).

Structs§

Detox
Configured detox pipeline runner. Construct via DetoxBuilder.
DetoxBuilder
Builder for Detox (FR-037).
DetoxReport
Summary report returned from Detox::execute (FR-042).
RenamePlanEntry
A single source→target rename mapping (FR-041).