Struct parkour::Error [−][src]
The error type when parsing command-line arguments. You can create an
Error
by creating an ErrorInner
and converting it with .into()
.
This error type supports an error source for attaching context to the error.
Implementations
impl Error
[src]
pub fn with_source(self, source: impl Error + Sync + Send + 'static) -> Self
[src]
Attach context to the error.
Usage
use parkour::{Error, util::Flag}; Error::missing_value() .with_source(Error::in_subcommand("test"))
This could produce the following output:
missing value
source: in subcommand `test`
pub fn no_value() -> Self
[src]
Create a NoValue
error
pub fn is_no_value(&self) -> bool
[src]
Returns true
if this is a NoValue
error
pub fn missing_value() -> Self
[src]
Create a MissingValue
error
pub fn is_missing_value(&self) -> bool
[src]
Returns true
if this is a MissingValue
error
pub fn early_exit() -> Self
[src]
Create a EarlyExit
error
pub fn is_early_exit(&self) -> bool
[src]
Returns true
if this is a EarlyExit
error
pub fn unexpected_value(got: impl ToString, expected: impl ToString) -> Self
[src]
Create a UnexpectedValue
error
pub fn missing_argument(arg: impl ToString) -> Self
[src]
Create a MissingArgument
error
pub fn in_argument(flag: &Flag<'_>) -> Self
[src]
Create a InArgument
error
pub fn in_subcommand(cmd: impl ToString) -> Self
[src]
Create a InSubcommand
error
Trait Implementations
impl Debug for Error
[src]
impl Display for Error
[src]
impl Error for Error
[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
[src]
pub fn backtrace(&self) -> Option<&Backtrace>
[src]
pub fn description(&self) -> &str
1.0.0[src]
pub fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl From<ErrorInner> for Error
[src]
fn from(inner: ErrorInner) -> Self
[src]
impl From<ParseFloatError> for Error
[src]
fn from(e: ParseFloatError) -> Self
[src]
impl From<ParseIntError> for Error
[src]
fn from(e: ParseIntError) -> Self
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Error
[src]
impl Send for Error
[src]
impl Sync for Error
[src]
impl Unpin for Error
[src]
impl !UnwindSafe for Error
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,