Enum ming::Error [−][src]
pub enum Error { MissingValue { option: Option<String>, }, UnexpectedOption(String), UnexpectedArgument(OsString), UnexpectedValue { option: Option<String>, value: OsString, }, ParsingFailed { value: String, error: Box<dyn Error + Send + Sync + 'static>, }, NonUnicodeValue(OsString), Custom(Box<dyn Error + Send + Sync + 'static>), }
Expand description
An error during argument parsing.
This implements From<String>
and From<&str>
, for easy ad-hoc error
messages.
It also implements From<OsString>
, as that’s used as an error type
by OsString::into_string
, so that method may be used with the try (?
)
operator.
Variants
An option argument was expected but was not found.
UnexpectedOption(String)
An unexpected option was found.
UnexpectedArgument(OsString)
A positional argument was found when none was expected.
An option had a value when none was expected.
Show 2 fields
Parsing a value failed. Returned by methods on ValueExt
.
Show 2 fields
NonUnicodeValue(OsString)
A value was found that was not valid unicode.
This can be returned by some methods on ValueExt
.
For custom error messages in application code.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error