Enum argyle::ArgyleError
source · [−]pub enum ArgyleError {
Custom(&'static str),
Empty,
NoArg,
NoSubCmd,
Passthru(i32),
TooManyArgs,
TooManyKeys,
WantsDynamicHelp(Option<Box<[u8]>>),
WantsHelp,
WantsVersion,
}
Expand description
Variants
Custom(&'static str)
A custom error.
Empty
Missing anything/everything.
NoArg
No trailing args.
NoSubCmd
Expected subcommand.
Passthru(i32)
Miscellaneous Silent Failure.
This has no corresponding error text, but does have its own exit code.
TooManyArgs
Too many arguments.
TooManyKeys
Too many options defined.
WantsDynamicHelp(Option<Box<[u8]>>)
Wants subcommand help.
WantsHelp
Wants help.
WantsVersion
Wants version.
Implementations
sourceimpl ArgyleError
impl ArgyleError
sourcepub const fn exit_code(&self) -> i32
pub const fn exit_code(&self) -> i32
Exit code.
This returns the exit code for the error. Non-error errors like help
and version have a non-error exit code of 0
. ArgyleError::Passthru
returns whatever code was defined, while everything else just returns
1
.
Trait Implementations
sourceimpl AsRef<str> for ArgyleError
impl AsRef<str> for ArgyleError
sourceimpl Clone for ArgyleError
impl Clone for ArgyleError
sourcefn clone(&self) -> ArgyleError
fn clone(&self) -> ArgyleError
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ArgyleError
impl Debug for ArgyleError
sourceimpl Display for ArgyleError
impl Display for ArgyleError
sourceimpl Error for ArgyleError
impl Error for ArgyleError
1.30.0 · sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
sourceimpl PartialEq<ArgyleError> for ArgyleError
impl PartialEq<ArgyleError> for ArgyleError
sourcefn eq(&self, other: &ArgyleError) -> bool
fn eq(&self, other: &ArgyleError) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ArgyleError) -> bool
fn ne(&self, other: &ArgyleError) -> bool
This method tests for !=
.
impl Eq for ArgyleError
impl StructuralEq for ArgyleError
impl StructuralPartialEq for ArgyleError
Auto Trait Implementations
impl RefUnwindSafe for ArgyleError
impl Send for ArgyleError
impl Sync for ArgyleError
impl Unpin for ArgyleError
impl UnwindSafe for ArgyleError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more