pub enum ArgType {
String,
Path,
Int,
Duration,
Var,
KeyValue,
OneOf(&'static [&'static str]),
Rest(&'static ArgType),
}Expand description
Closed vocabulary for argument value types.
The closed enum keeps the vocabulary compiler-checked and lets
docs-gen link each type cell to its reference section instead of
printing bare words like duration with no explanation.
Variants§
String
Path
Int
Duration
Var
KeyValue
OneOf(&'static [&'static str])
Inline alternation for one-off enums (e.g. SNAPSHOT|LOCAL).
Self-describing, so it renders unlinked.
Rest(&'static ArgType)
Trailing variadic repetition (e.g. RUN’s string...).
Implementations§
Source§impl ArgType
impl ArgType
Sourcepub fn anchor(&self) -> Option<&'static str>
pub fn anchor(&self) -> Option<&'static str>
Anchor of the type’s reference section (### Value type: <label>),
or None for self-describing inline alternations.
Sourcepub fn doc(&self) -> Option<(&'static str, &'static str)>
pub fn doc(&self) -> Option<(&'static str, &'static str)>
Reference-section (title, body) for the canonical types.
Sourcepub fn validate_literal(&self, literal: &str) -> Result<()>
pub fn validate_literal(&self, literal: &str) -> Result<()>
Validate a statically-known literal against this type.
Templates and variables are never passed here — see check_arg.
Sourcepub fn check_arg(&self, arg: &Arg) -> Result<CheckOutcome>
pub fn check_arg(&self, arg: &Arg) -> Result<CheckOutcome>
Classify one positional arg for lower-time checking.
Static literals validate now; templates, variables (except a
$var where Var is required), and mixed fragments defer to the
runtime resolvers, which see interpolated values.