pub struct Walk {
pub dirs: Vec<PathBuf>,
pub stopped: StopReason,
}Expand description
The directories walked: from the start outward (near to far).
Fields§
§dirs: Vec<PathBuf>Directories checked in order, [0] is the start.
stopped: StopReasonWhy the walk stopped. pmpx info displays it —
“why was no project found” is most often answered by having hit one of these.
Implementations§
Source§impl Walk
The two questions one walk up can answer.
impl Walk
The two questions one walk up can answer.
Both read the same candidate list, so a caller that needs both walks once and asks twice; the stop conditions cannot drift apart because there is only one traversal.
Sourcepub fn project_root(&self, is_root: impl Fn(&Path) -> bool) -> Option<PathBuf>
pub fn project_root(&self, is_root: impl Fn(&Path) -> bool) -> Option<PathBuf>
The project root: the nearest walked directory is_root accepts.
is_root comes from the caller, usually “this directory has a .pmpx.toml, or has one of
the detect files declared by an installed plugin”. It is a parameter so that this module
does not need to know about plugins.
Sourcepub fn config_paths(&self) -> Vec<PathBuf>
pub fn config_paths(&self) -> Vec<PathBuf>
Collect every .pmpx.toml on this walk, near to far.
The stop conditions match Walk::project_root; this order is the “nearest wins” merge rule
of pmpx_project::MergedProjectConfig.