pub trait Error {
type FlagList: FlagsList<'static>;
// Required methods
fn required_flag(
field: &'static str,
tags: Tags<'static>,
placeholder: &'static str,
) -> Self;
fn required_positional(
field: &'static str,
placeholder: &'static str,
) -> Self;
fn any_required_flag(list: Self::FlagList) -> Self;
fn flattened(field: &'static str, error: Self) -> Self;
fn required_subcommand(expected: &'static [&'static str]) -> Self;
fn custom(message: impl Display) -> Self;
}Expand description
Errors that can occur while converting the parsed arguments into the final structure. Generally these failures are related to the absence of required arguments; errors that are specific to a particular parameter or incoming argument are handled earlier.
Required Associated Types§
Sourcetype FlagList: FlagsList<'static>
type FlagList: FlagsList<'static>
When reporting any_required_flag, we need to
be able to report a list of flags. This type allows the error to define the
container it wants to use for those flags.
Required Methods§
Sourcefn required_flag(
field: &'static str,
tags: Tags<'static>,
placeholder: &'static str,
) -> Self
fn required_flag( field: &'static str, tags: Tags<'static>, placeholder: &'static str, ) -> Self
A required flag wasn’t present.
Sourcefn required_positional(field: &'static str, placeholder: &'static str) -> Self
fn required_positional(field: &'static str, placeholder: &'static str) -> Self
A required positional field wasn’t present.
Sourcefn any_required_flag(list: Self::FlagList) -> Self
fn any_required_flag(list: Self::FlagList) -> Self
At least one of the flags in this list were required.
Sourcefn flattened(field: &'static str, error: Self) -> Self
fn flattened(field: &'static str, error: Self) -> Self
There was an error building a flattened field.
Sourcefn required_subcommand(expected: &'static [&'static str]) -> Self
fn required_subcommand(expected: &'static [&'static str]) -> Self
We required a subcommand, but none was provided.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".