pub struct OptionSpec { /* private fields */ }Expand description
One option a pass takes: its key, whether it is needed, an example value and what it means. Built only by its constructors, so a required option always has its example and an optional one always says what its absence means.
Implementations§
Source§impl OptionSpec
impl OptionSpec
Sourcepub const fn required(
key: &'static str,
example: &'static str,
doc: &'static str,
) -> Self
pub const fn required( key: &'static str, example: &'static str, doc: &'static str, ) -> Self
An option a pipeline must give.
Sourcepub const fn optional(
key: &'static str,
example: &'static str,
doc: &'static str,
absent: &'static str,
) -> Self
pub const fn optional( key: &'static str, example: &'static str, doc: &'static str, absent: &'static str, ) -> Self
An option a pipeline may give; absent says what no value means (the registry refuses an empty one). Its
example only documents it: optional options may exclude each other (at=centre or east and north), so the
registry makes no pass from them.
Sourcepub const fn one_of(
group: &'static str,
key: &'static str,
example: &'static str,
doc: &'static str,
) -> Self
pub const fn one_of( group: &'static str, key: &'static str, example: &'static str, doc: &'static str, ) -> Self
One of the options of group, of which a pipeline gives exactly one.
Sourcepub const fn one_of_choice<T: Choice>(
group: &'static str,
key: &'static str,
doc: &'static str,
) -> Self
pub const fn one_of_choice<T: Choice>( group: &'static str, key: &'static str, doc: &'static str, ) -> Self
One of the options of group, of which a pipeline gives exactly one, whose value is one of T’s; the example
is the first. Read by Given::optional_choice.
Sourcepub const fn choice<T: Choice>(key: &'static str, doc: &'static str) -> Self
pub const fn choice<T: Choice>(key: &'static str, doc: &'static str) -> Self
A required option whose value is one of T’s; the example is the first.
Sourcepub const fn optional_choice<T: Choice>(
key: &'static str,
doc: &'static str,
absent: &'static str,
) -> Self
pub const fn optional_choice<T: Choice>( key: &'static str, doc: &'static str, absent: &'static str, ) -> Self
An optional option whose value, when given, is one of T’s; absent says what no value means.