pub struct EmptyError;Expand description
A simple argument parsing error type that contains no data. Mostly used for testing and code examples.
Trait Implementations§
Source§impl Clone for EmptyError
impl Clone for EmptyError
Source§fn clone(&self) -> EmptyError
fn clone(&self) -> EmptyError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EmptyError
impl Debug for EmptyError
Source§impl Default for EmptyError
impl Default for EmptyError
Source§fn default() -> EmptyError
fn default() -> EmptyError
Returns the “default value” for a type. Read more
Source§impl Display for EmptyError
impl Display for EmptyError
Source§impl<'arg> Error<'arg> for EmptyError
impl<'arg> Error<'arg> for EmptyError
Source§fn got_arg(_: &'arg Arg) -> Self
fn got_arg(_: &'arg Arg) -> Self
The parameter is a
--switch; it must NOT have a value, and got one.Source§fn got_additional_instance() -> Self
fn got_additional_instance() -> Self
The argument appeared more times than expected (usually more than once) on
the command line
Source§fn invalid_utf8(_: &'arg Arg) -> Self
fn invalid_utf8(_: &'arg Arg) -> Self
The argument wasn’t valid UTF-8 and should be.
Source§fn parse_error(_: &str, _: impl Display) -> Self
fn parse_error(_: &str, _: impl Display) -> Self
The argument was valid UTF-8, but it failed to parse into an instance of
the type.
Source§fn byte_parse_error(_: &'arg Arg, _: impl Display) -> Self
fn byte_parse_error(_: &'arg Arg, _: impl Display) -> Self
The argument failed to parse into an instance of the type.
Source§impl<'arg> Error<'arg> for EmptyError
impl<'arg> Error<'arg> for EmptyError
type StateError<A> = EmptyError
Source§fn positional(_: &'arg Arg, _: Self) -> Self
fn positional(_: &'arg Arg, _: Self) -> Self
There was an error handling a positional argument
Source§fn long_with_argument(_: &'arg Arg, _: &'arg Arg, _: Self) -> Self
fn long_with_argument(_: &'arg Arg, _: &'arg Arg, _: Self) -> Self
There was an error handling a
--long=argument argumentSource§impl<'arg, A> Error<'arg, A> for EmptyError
impl<'arg, A> Error<'arg, A> for EmptyError
Source§type ParameterError = EmptyError
type ParameterError = EmptyError
Error type for parameter errors (see
parameter).Source§type FlagList = EmptyError
type FlagList = EmptyError
List of flags for
conflicts_with_flags.Source§fn parameter(_: &'static str, _: Self::ParameterError) -> Self
fn parameter(_: &'static str, _: Self::ParameterError) -> Self
A parameter type returned an error. This means that the argument was
recognized and matched to a specific field, but something went wrong during
parsing, such as a letter appearing in a numeric parameter.
Source§fn unrecognized(_: A) -> Self
fn unrecognized(_: A) -> Self
An argument was unrecognized. In this case, the Argument can be returned
unused inside of
Self, so that it can be retried by a different parser.
For instance, a subcommand parser could indicate that an argument is
unrecognized, and that argument can later be handled as a global argument.Source§fn flattened(_: &'static str, _: Self) -> Self
fn flattened(_: &'static str, _: Self) -> Self
There was a state error from another
State inside of this one.Source§fn unknown_subcommand(_: &'static [&'static str]) -> Self
fn unknown_subcommand(_: &'static [&'static str]) -> Self
The positional argument was interpreted as a subcommand, but wasn’t
recognized as a known subcommand. The list of known subcommands is
given.
Source§fn wrong_subcommand_for_argument(_: &str, _: &[&'static str]) -> Self
fn wrong_subcommand_for_argument(_: &str, _: &[&'static str]) -> Self
The option was recognized, but it isn’t a valid for this particular
subcommand. The current subcommand, along with the list of subcommands
that accept this option, are given
Source§fn conflicts_with_flags(_flags: Self::FlagList) -> Self
fn conflicts_with_flags(_flags: Self::FlagList) -> Self
The argument conflicts with the given flags that were already parsed.
Source§fn help_requested(_: HelpRequest) -> Self
fn help_requested(_: HelpRequest) -> Self
This was a request for a usage message. This error doesn’t need to
interrupt argument parsing, since it can be useful to have a complete
state object to print more contextually useful usage messages.
Source§impl Error for EmptyError
impl Error for EmptyError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl Error for EmptyError
impl Error for EmptyError
Source§type FlagList = EmptyError
type FlagList = EmptyError
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.Source§fn required_flag(_: &'static str, _: Tags<'static>, _: &'static str) -> Self
fn required_flag(_: &'static str, _: Tags<'static>, _: &'static str) -> Self
A required flag wasn’t present.
Source§fn required_positional(_: &'static str, _: &'static str) -> Self
fn required_positional(_: &'static str, _: &'static str) -> Self
A required positional field wasn’t present.
Source§fn any_required_flag(_: Self::FlagList) -> Self
fn any_required_flag(_: Self::FlagList) -> Self
At least one of the flags in this list were required.
Source§fn required_subcommand(_: &'static [&'static str]) -> Self
fn required_subcommand(_: &'static [&'static str]) -> Self
We required a subcommand, but none was provided.
Source§impl<'a> FlagsList<'a> for EmptyError
impl<'a> FlagsList<'a> for EmptyError
impl Copy for EmptyError
Auto Trait Implementations§
impl Freeze for EmptyError
impl RefUnwindSafe for EmptyError
impl Send for EmptyError
impl Sync for EmptyError
impl Unpin for EmptyError
impl UnwindSafe for EmptyError
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
Mutably borrows from an owned value. Read more