Skip to main content

Crate dsopt

Crate dsopt 

Source
Expand description

Core scanning, sizing, caching, and removal logic for dsopt.

The scanner walks a filesystem root once with a rayon thread pool and reports directories whose name matches a known build-artifact detector (node_modules or target). Nested detectors are folded into their outermost parent so a single removal reclaims the whole subtree.

Modules§

app
The dsopt terminal user interface: scan, select, and reclaim.
update
Self-update support: ask crates.io for the latest release and, when it is newer than the running binary, reinstall through cargo install.

Structs§

Candidate
A reclaimable directory together with the size of its whole subtree.
FileIdentity
Identity of a directory on its filesystem, used to collapse macOS volume aliases.
ProgressSnapshot
Point-in-time copy of ScanState, safe to render.
ScanCache
Serialized form of the most recent completed scan.
ScanResult
Outcome of a completed scan.
ScanState
Live counters shared between the walker threads and the progress reporter.

Enums§

CandidateKind
A directory shape that dsopt knows how to reclaim.

Constants§

THREAD_RANGE
Thread counts outside this range are rejected, matching the CLI contract.

Functions§

cache_path
Location of the on-disk scan cache, honouring XDG_CACHE_HOME.
deduplicate_candidates
Keep only the first candidate for each (device, inode) pair.
format_size
Render a byte count the way the TUI and CLI both display it.
format_timestamp
Format Unix seconds as YYYY-MM-DD HH:MM UTC without pulling in a date crate.
is_safe_candidate
Whether path is a directory beneath scan_root that is safe to delete.
load_scan_cache
remove_candidate
Permanently delete a candidate directory after a safety re-check.
save_scan_cache
scan
Scan a root with a fresh ScanState.
scan_with_state
Scan a root, publishing live counters into state while the walk runs.
should_skip
Whether path sits on a virtual filesystem or macOS volume alias.