Expand description
RustdvPath — a component’s position in the tree, as segments.
The path is derived by the walk and never stored on a component (D7).
Making it a type rather than a String buys three things:
- It cannot be fabricated. A
RustdvPathis produced only by the framework’s walk (RustdvPath::rootthenRustdvPath::child), so a user cannot hand-type"env.loga"where a path is expected. That is the guarantee D7 and D62 exist to protect: the oldLogger::new("env.loga")kept compiling — and kept addressing the wrong subtree — after a rename. - Prefix matching is correct by construction. Comparing segment lists
cannot confuse
abwith a child ofa, which the string form had to special-case (D64). - Depth is a count, not a scan — and D13’s config precedence is scaled by the setter’s depth.
The rendered dotted form is cached alongside the segments, so Display and
as_str() are free and every log line prints exactly as it always has.
Structs§
Functions§
- str_
is_ under - Segment-wise “is
pathat or belowprefix?” for the string form, used by the log module’s per-subtree handlers where prefixes arrive as text.