pub enum Source {
NativeDynamic {
protocol: String,
},
KnownSpec {
provider: String,
},
CompletionScript {
shell: String,
},
ManPage {
format: ManFormat,
},
HelpText,
HelpTextSynopsis,
UserOverride,
}Expand description
The origin of a piece of extracted data. See spec §4.2 and §7.
Variants§
NativeDynamic
A native, version-accurate dynamic probe (Tier E): cobra
__complete, clap CompleteEnv, argcomplete.
Fields
KnownSpec
A vendored or live structured catalog (Tier A).
CompletionScript
Structural parsing of a generated shell completion script (Tier C).
ManPage
Man page extraction (Tier D).
HelpText
--help/-h/help grammar parsing (Tier B) of a structured block
(an options table, .TP-shaped entry, or similar) that carries
prose alongside each flag.
HelpTextSynopsis
--help/-h/help grammar parsing (Tier B) of a usage synopsis
line specifically (spec [M-15]): git --help’s
[-p | --paginate | -P | --no-pager], mined by
help_text::sections::extract_usage_flags. A separate variant
rather than a field on HelpText, because a synopsis is genuinely a
different extraction site — the same reason ManPage carries
format and CompletionScript carries shell instead of HelpText
growing a field each of them would also need.
A usage synopsis lists spellings and value shapes only, never
prose, by construction — spec §7 Tier B forbids fabricating a
description for one from neighbouring text. A flag whose only
source is this variant is therefore structurally undescribable, not
merely undescribed: Source::can_describe says so, and spec
§13’s pct_flags_with_text excludes it from the denominator rather than
punishing recall for having found it (the defect [M-15] and this
redefinition both exist to fix — see spec §13’s metric design
rules).
UserOverride
A user-local override file (Tier F).
Implementations§
Source§impl Source
impl Source
This source’s two-axis Authority, per spec §4.4’s table.
Sourcepub fn can_describe(&self) -> bool
pub fn can_describe(&self) -> bool
Whether this source could, in principle, have supplied a
description — spec §13’s metric design rules (rule 2:
“denominators are conditioned on what the source could have
provided”). false only for Source::HelpTextSynopsis: a usage
synopsis lists spellings and value shapes, never prose, by
construction. Every other source at least could have carried a
description, whether or not it did for a given flag.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Source
impl<'de> Deserialize<'de> for Source
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Source
impl StructuralPartialEq for Source
Auto Trait Implementations§
impl Freeze for Source
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnsafeUnpin for Source
impl UnwindSafe for Source
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.