pub struct UsageError(pub String);Expand description
Typed error for bad CLI input / range errors (maps to ExitCode::Usage).
Use this instead of bare anyhow!() for usage errors so that
classify_error can downcast instead of matching on message strings.
Tuple Fields§
§0: StringTrait Implementations§
Source§impl Debug for UsageError
impl Debug for UsageError
Source§impl Display for UsageError
impl Display for UsageError
Source§impl Error for UsageError
impl Error for UsageError
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()
Auto Trait Implementations§
impl Freeze for UsageError
impl RefUnwindSafe for UsageError
impl Send for UsageError
impl Sync for UsageError
impl Unpin for UsageError
impl UnsafeUnpin for UsageError
impl UnwindSafe for UsageError
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