Skip to main content

Module path

Module path 

Source
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:

  1. It cannot be fabricated. A RustdvPath is produced only by the framework’s walk (RustdvPath::root then RustdvPath::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 old Logger::new("env.loga") kept compiling — and kept addressing the wrong subtree — after a rename.
  2. Prefix matching is correct by construction. Comparing segment lists cannot confuse ab with a child of a, which the string form had to special-case (D64).
  3. 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§

RustdvPath

Functions§

str_is_under
Segment-wise “is path at or below prefix?” for the string form, used by the log module’s per-subtree handlers where prefixes arrive as text.