pub struct Candidate { /* private fields */ }Expand description
Implementations§
Source§impl Candidate
impl Candidate
Sourcepub fn path(&self) -> &Path
pub fn path(&self) -> &Path
The path of this candidate as discovered (input, PATH entry, symlink target, etc.). Not necessarily canonicalized.
Sourcepub fn canonical(&self) -> &Path
pub fn canonical(&self) -> &Path
The canonical path of this candidate.
When std::fs::canonicalize succeeds this is the real (symlink- and
..-resolved) path. When it fails, it falls back to the candidate’s
own path, so this is not guaranteed to always be a realpath.
The observed tags describing this candidate.
Tag order is not guaranteed (PathTag::Input /
PathTag::InPathEnv happen to lead, but other tags follow in
implementation order). Test membership with
tags().contains(...) / tags().iter().any(...), not by position.
Sourcepub fn durability(&self) -> Durability
pub fn durability(&self) -> Durability
The Durability of this candidate’s path: whether the
path string can be pinned into a service definition and survive
rebuild / upgrade / reboot.
Judged per candidate, so the reference path and the canonical path of
the same binary can differ (e.g. /opt/homebrew/bin/git is
Durable while
/opt/homebrew/Cellar/git/2.44.0/bin/git is
NotDurable). See Durability for the
judging model and its known limitations.
Sourcepub fn is_stable(&self) -> bool
pub fn is_stable(&self) -> bool
Whether this candidate is durable-to-pin: true iff
durability is Durability::Durable.
Durability::Unknown is treated as not stable (safe side).