Skip to main content

Module path_history

Module path_history 

Source
Expand description

Type-state pipeline that canonicalizes and boundary-checks paths.

PathHistory<S> is a newtype over PathBuf whose phantom type parameter S records which validation stages have been applied. The compiler rejects use of a partially-validated path where a fully-validated one is required, making it impossible to skip a stage accidentally. The states flow: Raw → Canonicalized → BoundaryChecked (strict) or Raw → (Virtualized) → Canonicalized → BoundaryChecked (virtual). This module is internal; callers interact through PathBoundary and VirtualRoot.

Structs§

BoundaryChecked
Proven to reside within the boundary — ready for StrictPath construction.
Canonicalized
Fully canonicalized — ., .., and symlinks resolved to real targets.
Exists
Canonicalized path confirmed to exist as a directory (used for boundary roots).
PathHistory
Type-state wrapper over PathBuf recording which validation stages have been applied.
Raw
Unvalidated state — constructed from any AsRef<Path> input.
Virtualized
Pre-canonicalization: components clamped in virtual space so .. cannot walk above the virtual root.