pub enum SettingGiven {
Bool(bool),
Int(i64),
Text(String),
List(Vec<String>),
NotText,
}Expand description
One value a flag was given, in a vocabulary this crate can hold.
A settings layer is usage-config’s idea, and this crate does not know that crate exists —
but a group of flags declared once and flattened into several commands is this crate’s
idea, and its values have to reach the command that owns them somehow. So a flattened group
hands its parent what it was given in these terms, and the parent, which is the one place
that knows what a setting is, turns them into the layer.
Deliberately small: what a flag can be given, and nothing about types. The registry decides
what "8" means, and a second opinion here would be the first thing to disagree with it.
Variants§
Bool(bool)
A switch, true for the flag and false for its negation. Given either way.
Int(i64)
A count: -vvv is three.
Text(String)
A flag’s argument, as text.
List(Vec<String>)
A repeated flag, item by item — joining them would lose an item holding the separator.
NotText
A value that is not text at all: bytes an argument can hold and a setting cannot. Said rather than rendered, because rendering it lossily sets a setting to a value nobody typed.
Trait Implementations§
Source§impl Clone for SettingGiven
impl Clone for SettingGiven
Source§fn clone(&self) -> SettingGiven
fn clone(&self) -> SettingGiven
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more