#[non_exhaustive]pub struct SpecConfigProp {Show 28 fields
pub optional: Option<bool>,
pub aliases: Vec<String>,
pub default: Option<SpecConfigValue>,
pub default_note: Option<String>,
pub data_type: SpecDataTypes,
pub value_type: Option<SpecConfigType>,
pub env: Option<String>,
pub envs: Vec<String>,
pub deprecated_envs: Vec<String>,
pub cli: Vec<String>,
pub bindings: BTreeMap<String, Vec<String>>,
pub help: Option<String>,
pub long_help: Option<String>,
pub help_heading: Option<String>,
pub choices: Vec<SpecConfigChoice>,
pub merge: SpecConfigMerge,
pub scope: SpecConfigScope,
pub deprecated: Option<String>,
pub deprecated_warn_at: Option<String>,
pub deprecated_remove_at: Option<String>,
pub renamed_to: Option<String>,
pub hide: bool,
pub since: Option<String>,
pub parse: Option<String>,
pub writes_to: Option<String>,
pub examples: Vec<String>,
pub default_list: Vec<SpecConfigValue>,
pub extensions: Vec<(String, SpecConfigValue)>,
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.optional: Option<bool>Whether absence is a legitimate resolved value.
None keeps the inferred rule: an option<T> or a property without a default is
optional. An explicit value lets a registry state the contract instead of relying on
that inference.
aliases: Vec<String>Equivalent config keys accepted without a deprecation warning.
default: Option<SpecConfigValue>§default_note: Option<String>§data_type: SpecDataTypesThe old five-value type, kept so a spec written against it still means what it said.
type is the one to write now; this is set from it where the two overlap, so a
consumer reading either sees the same thing.
value_type: Option<SpecConfigType>The type, in the expression grammar: list<string>, option<path>, bool|string.
env: Option<String>The first environment variable, kept for the specs that wrote env=.
envs: Vec<String>Every environment variable that sets this, highest precedence first.
deprecated_envs: Vec<String>Environment aliases still read after current names, with a deprecation warning.
cli: Vec<String>Flags that set this, as declared elsewhere in the spec.
bindings: BTreeMap<String, Vec<String>>Keys this setting has in a custom source kind, by kind name.
help: Option<String>§long_help: Option<String>§help_heading: Option<String>The section to list this under in generated docs.
choices: Vec<SpecConfigChoice>§merge: SpecConfigMerge§scope: SpecConfigScope§deprecated: Option<String>§deprecated_warn_at: Option<String>§deprecated_remove_at: Option<String>§renamed_to: Option<String>The property that replaces this one, so a value arriving under the old name can be folded into the new one rather than ignored.
hide: boolKeep it out of docs and completions.
since: Option<String>The version that introduced it.
parse: Option<String>A named parser for turning one string into this type — list_by_comma and friends.
Vocabulary rather than code, so any implementation can honor it.
writes_to: Option<String>Where config set should write this, when it is not the usual file.
examples: Vec<String>§default_list: Vec<SpecConfigValue>A list-valued default, which cannot be written as a single property.
Typed like the scalar default, so default 1 2 3 for a list<int> stays three
numbers all the way to the JSON schema instead of becoming three strings.
extensions: Vec<(String, SpecConfigValue)>Anything a tool needs to carry that usage does not interpret.
Preserved in order and written back out, so a registry with tool-private metadata
(mise.rust_type, aube.npm_shared) round-trips through the spec untouched.
Implementations§
Source§impl SpecConfigProp
impl SpecConfigProp
Sourcepub fn env(self, env: impl Into<String>) -> Self
pub fn env(self, env: impl Into<String>) -> Self
An environment variable that sets this property.
Call it more than once for aliases, highest precedence first, the way
env "HK_JOBS" "HK_JOB" reads in a spec. Both env and envs are maintained, so a
consumer can read either — the parser holds the same invariant, and a builder that
left envs empty meant a programmatically built spec serialized without the variable
every reader of envs looks for.
Sourcepub fn deprecated_env(self, env: impl Into<String>) -> Self
pub fn deprecated_env(self, env: impl Into<String>) -> Self
A deprecated environment alias, read after every current name.
Sourcepub fn default_value(self, default: impl Into<SpecConfigValue>) -> Self
pub fn default_value(self, default: impl Into<SpecConfigValue>) -> Self
Default value, rendered in docs.
Trait Implementations§
Source§impl Clone for SpecConfigProp
impl Clone for SpecConfigProp
Source§fn clone(&self) -> SpecConfigProp
fn clone(&self) -> SpecConfigProp
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SpecConfigProp
impl Debug for SpecConfigProp
Source§impl Default for SpecConfigProp
impl Default for SpecConfigProp
Source§impl PartialEq for SpecConfigProp
impl PartialEq for SpecConfigProp
Source§impl Serialize for SpecConfigProp
impl Serialize for SpecConfigProp
impl StructuralPartialEq for SpecConfigProp
Auto Trait Implementations§
impl Freeze for SpecConfigProp
impl RefUnwindSafe for SpecConfigProp
impl Send for SpecConfigProp
impl Sync for SpecConfigProp
impl Unpin for SpecConfigProp
impl UnsafeUnpin for SpecConfigProp
impl UnwindSafe for SpecConfigProp
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,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more