Skip to main content

Module virtual_root

Module virtual_root 

Source
Expand description

VirtualRoot<Marker> — the factory for VirtualPath values clamped to a virtual root.

A VirtualRoot wraps a PathBoundary and maps all paths into a virtual namespace rooted at "/". Traversal past the root is clamped (not rejected): virtual_join("../../x") resolves to "/x" rather than escaping the real filesystem boundary. This makes VirtualRoot safe to expose to untrusted input even without returning errors.

Structs§

VirtualRoot
Provide a user‑facing virtual root that produces VirtualPath values clamped to a boundary.
VirtualRootReadDir
Iterator over directory entries that yields validated VirtualPath values.