Enum ContextKind
#[non_exhaustive]
pub enum ContextKind
Semantics for a piece of error information
Variants
-
InvalidSubcommand The cause of the error
-
InvalidArg The cause of the error
-
PriorArg Existing arguments
-
ValidSubcommand Accepted subcommands
-
ValidValue Accepted values
-
InvalidValue Rejected values
-
ActualNumValues Number of values present
-
ExpectedNumValues Number of allowed values
-
MinValues Minimum number of allowed values
-
SuggestedCommand Potential fix for the user
-
SuggestedSubcommand Potential fix for the user
-
SuggestedArg Potential fix for the user
-
SuggestedValue Potential fix for the user
-
TrailingArg Trailing argument
-
Suggested Potential fix for the user
-
Usage A usage string
-
Custom An opaque message to the user
Implementations
impl ContextKind
fn as_str(self) -> Option<&'static str>End-user description of the error case, where relevant
Trait Implementations
impl Clone for ContextKind
fn clone(&self) -> ContextKind
impl Copy for ContextKind
impl Debug for ContextKind
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Display for ContextKind
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for ContextKind
impl Hash for ContextKind
fn hash<__H: Hasher>(&self, state: &mut __H)
impl PartialEq for ContextKind
fn eq(&self, other: &ContextKind) -> bool
impl StructuralPartialEq for ContextKind
Auto Trait Implementations
impl Freeze for ContextKind
impl RefUnwindSafe for ContextKind
impl Send for ContextKind
impl Sync for ContextKind
impl Unpin for ContextKind
impl UnsafeUnpin for ContextKind
impl UnwindSafe for ContextKind
Blanket Implementations
impl<T> Any for ContextKind
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for ContextKind
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for ContextKind
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for ContextKind
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for ContextKind
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for ContextKind
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T> ToString for ContextKind
where
T: Display + ?Sized,
fn to_string(&self) -> String
impl<T, U> Into<U> for ContextKind
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for ContextKind
where
U: Into<T>,
type Error = Infallible;fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for ContextKind
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>