pub enum Line {
Usable(Declared),
Broken {
name: String,
stage: Stage,
lineno: usize,
why: ParseError,
},
}Expand description
One manifest line: usable, or not.
A SUM, not a struct with an Option<why> beside the fields. The struct
form let a broken line carry a severity, a scope and an argv that meant
nothing — and it produced a wrong diagnosis: because broken and usable
entries shared one list, a valid line was rejected as “declared twice” for
colliding with a line that could not run. Dedup now sees only Usable.
Separate from External because the fleet reads ninety-six manifests and may
re-read them on every refresh, while External holds a Scope whose
&'static slices are LEAKED.
Variants§
Implementations§
Source§impl Line
impl Line
pub fn name(&self) -> &str
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.