pub enum Line {
Usable(Declared),
Tool(ToolPin),
Policy {
what: PolicyLine,
lineno: usize,
},
Broken {
name: String,
stage: Stage,
lineno: usize,
why: ParseError,
},
}Variants§
Usable(Declared)
Tool(ToolPin)
A tool version pin — carries no check.
Policy
A policy statement — carries no check either. The line number rides along because a “names no check here” note must point somewhere.
Broken
Implementations§
Source§impl Line
impl Line
pub fn name(&self) -> &str
Sourcepub fn is_check(&self) -> bool
pub fn is_check(&self) -> bool
Does this line declare a CHECK? Tool and Policy lines do not, and
every consumer that projects lines into checks — parse, the trust
prompt, the fleet’s declared column — must filter on this rather than
pattern-match variants it will forget to extend. A Broken line IS a
check (one that runs to Unavailable and says why).
pub fn stage(&self) -> Stage
Sourcepub fn broken(&self) -> Option<String>
pub fn broken(&self) -> Option<String>
Some(reason) when this line declares a check that cannot run.
Sourcepub fn id(&self) -> String
pub fn id(&self) -> String
<trigger>-<name>, matching Declared::id and External::id. A broken
line has one too: hook.skip pre-commit should silence its nag exactly
as it silences the checks that do run.
Sourcepub fn into_parts(self) -> (String, Stage, Result<Declared, String>)
pub fn into_parts(self) -> (String, Stage, Result<Declared, String>)
Consume into the identity every line has, and either the declaration or the reason there is none.
Both consumers — External::from and the fleet’s projection — used to
destructure this by hand, and both carried an arm for a combination the
type forbids, because they computed the reason BEFORE matching. Written
once, that arm has nowhere to appear.