#[non_exhaustive]pub struct Detox {
pub verbose: bool,
pub dry_run: bool,
pub recursive: bool,
pub collision_cap: u32,
/* private fields */
}Expand description
Configured detox pipeline runner. Construct via DetoxBuilder.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.verbose: boolVerbose: emit one rename line per change to stdout.
dry_run: boolDry-run: plan and report renames without issuing any rename syscalls.
recursive: boolRecursive: descend into directories depth-first leaves-up.
collision_cap: u32Maximum collision-resolution suffix attempts before giving up.
Implementations§
Source§impl Detox
impl Detox
Sourcepub fn sanitize(&self, input: &str) -> String
pub fn sanitize(&self, input: &str) -> String
Sanitize one UTF-8 input string, returning UTF-8 output (FR-040).
Lossy reconstruction via String::from_utf8_lossy handles the rare
case where the active sequence includes Filter::Uncgi and the
input contains percent-escapes that decode to invalid UTF-8 fragments
(e.g., a lone %C3). In that case the invalid byte is replaced with
U+FFFD in the &str path. Callers needing byte-exact round-tripping
for arbitrary inputs MUST use Detox::sanitize_bytes.
Sourcepub fn sanitize_bytes(&self, input: &[u8]) -> Vec<u8> ⓘ
pub fn sanitize_bytes(&self, input: &[u8]) -> Vec<u8> ⓘ
Canonical byte-oriented sanitization entry point (FR-040).
Applies the configured Sequence to input and returns the
transformed bytes. No filesystem I/O.
Sourcepub fn plan(&self, path: &Path) -> Vec<RenamePlanEntry>
pub fn plan(&self, path: &Path) -> Vec<RenamePlanEntry>
Planned rename(s) for path without executing them (FR-041).
Performs filesystem READS (readdir, stat) as required to enumerate
directory contents and check for pre-existing collision targets, but
no filesystem MUTATION. Side-effect-free with respect to writes/logs.
Sourcepub fn execute(&self, path: &Path) -> Result<DetoxReport, DetoxError>
pub fn execute(&self, path: &Path) -> Result<DetoxReport, DetoxError>
Execute the rename(s) for path (FR-042).
Produces the same plan as Detox::plan and iterates it issuing
rename syscalls (with EXDEV fallback per FR-025). Returns a
DetoxReport on success or a DetoxError on the first
unrecoverable failure.