pub enum FlagError {
BadFlag {
flag: String,
},
UnknownFlag {
name: String,
},
ArgumentNeeded {
name: String,
},
ParseError {
error: FlagParseError,
},
}
Expand description
Common errors for flag parsing.
Variants§
BadFlag
Bad flag syntax. E.g. --=foo
UnknownFlag
Flag provided but not defined.
ArgumentNeeded
Flag needs an argument.
ParseError
Failed to parse a flag argument. E.g. --lines=10XYZ
Fields
§
error: FlagParseError
Trait Implementations§
Source§impl Error for FlagError
impl Error for FlagError
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
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
Auto Trait Implementations§
impl Freeze for FlagError
impl RefUnwindSafe for FlagError
impl Send for FlagError
impl Sync for FlagError
impl Unpin for FlagError
impl UnwindSafe for FlagError
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