#[non_exhaustive]pub enum Error {
UnexpectedArg {
metadata: Metadata,
raw_arg: String,
},
UndefinedCommand {
metadata: Metadata,
raw_arg: String,
},
MissingCommand {
metadata: Metadata,
},
InvalidArg {
arg: Box<Arg>,
reason: String,
},
MissingArg {
arg: Box<Arg>,
},
InvalidOpt {
opt: Box<Opt>,
reason: String,
},
MissingOpt {
opt: Box<Opt>,
},
Other {
metadata: Option<Metadata>,
error: Box<dyn Display>,
},
}Expand description
Possible errors.
Note that this enum is intended to be used only as a top-level error and
deliberately does not implement the std::error::Error and std::fmt::Display traits.
Additionally, any external errors that implement std::fmt::Display can be converted into this error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl !Send for Error
impl !Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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