pub struct Directive {
pub cli_flag: &'static str,
pub yaml_directive: &'static str,
pub yaml_form: YamlForm,
pub applies_to: KindMask,
pub target: DirectiveTarget,
pub value: ValueProvider,
pub repeatable: bool,
}Expand description
One directive: its CLI flag, its YAML directive name, the kinds it applies to, and the value-space it consumes.
cli_flag is always --<name>. yaml_directive is the
keyword the YAML parser recognises; for some directives
the YAML form is <name> <value> (no =) and for others
it’s <name>=<value>. [yaml_form] captures that.
Fields§
§cli_flag: &'static strCLI long flag (e.g. --over, --palette).
yaml_directive: &'static strYAML directive keyword (e.g. over, palette).
yaml_form: YamlFormWhether the YAML form uses = or whitespace
between keyword and value.
applies_to: KindMaskKinds the directive applies to. Per-item declarations on a non-applicable kind warn at parse time (SRD-46 §“Style and metadata directives”).
target: DirectiveTargetWhere the directive’s value lands in the AST.
value: ValueProviderValue-space for completion + parser validation.
repeatable: boolWhether the flag may appear more than once in one
command-line invocation (e.g. --series is
repeatable; --label is not).
Trait Implementations§
impl Eq for Directive
impl StructuralPartialEq for Directive
Auto Trait Implementations§
impl Freeze for Directive
impl RefUnwindSafe for Directive
impl Send for Directive
impl Sync for Directive
impl Unpin for Directive
impl UnsafeUnpin for Directive
impl UnwindSafe for Directive
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.