pub enum InvalidOption {
OptionContainsInvalidChar {
option: String,
},
UnconfiguredOption {
option: String,
},
OptionNeedsArg {
option: String,
store_key: String,
},
OptionTakesNoArg {
option: String,
store_key: String,
},
OptionIsNotArray {
option: String,
store_key: String,
},
StoreKeyIsDuplicated {
store_key: String,
name: String,
},
ConfigIsArrayButHasNoArg {
store_key: String,
name: String,
},
ConfigHasDefaultsButHasNoArg {
store_key: String,
name: String,
},
OptionNameIsDuplicated {
store_key: String,
name: String,
},
OptionArgIsInvalid {
store_key: String,
option: String,
opt_arg: String,
details: String,
},
}Expand description
The enum type for errors of options or option arguments.
This enum type has option() method, which makes it possible to handle option-related errors
in a unified manner.
Variants§
OptionContainsInvalidChar
Indicates that the name of an option is using invalid characters. This error occurs if the name contains symbols or starts with a symbol or number.
UnconfiguredOption
Indicates that the option with the specified name does not exist in the option configurations.
OptionNeedsArg
Indicates that the option requires arguments in the configuration, but no argument is specified.
Fields
OptionTakesNoArg
Indicates that the option is not suppoesed to take an argument in the configuration, but an argument is specified.
Fields
OptionIsNotArray
Indicates that the option is supposed to take one argument in the configuration, but multiple arguments are specified.
Fields
StoreKeyIsDuplicated
Indicates that there are duplicated store keys among multiple configurations.
Fields
ConfigIsArrayButHasNoArg
Indicates that an option configuration contradicts that the option can take multiple
arguments (.is_array == true) though it does not take option arguments
(.has_arg == false).
Fields
ConfigHasDefaultsButHasNoArg
Indicates that an option configuration contradicts that the default arguments (.defaults)
is not empty though it does not take option arguments (.has_arg == false).
Fields
OptionNameIsDuplicated
Indicates that there are duplicated opton names among the option configurations.
Fields
OptionArgIsInvalid
Indicates that the option argument is invalidated by the validator in the option configuration.
Implementations§
Trait Implementations§
source§impl Debug for InvalidOption
impl Debug for InvalidOption
source§impl Display for InvalidOption
impl Display for InvalidOption
source§impl Error for InvalidOption
impl Error for InvalidOption
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl PartialEq for InvalidOption
impl PartialEq for InvalidOption
impl StructuralPartialEq for InvalidOption
Auto Trait Implementations§
impl Freeze for InvalidOption
impl RefUnwindSafe for InvalidOption
impl Send for InvalidOption
impl Sync for InvalidOption
impl Unpin for InvalidOption
impl UnwindSafe for InvalidOption
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> 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