Message

Enum Message 

Source
pub(crate) enum Message {
Show 17 variants NoEnv(&'static str), ParseSome(&'static str), ParseFail(&'static str), PureFailed(String), Missing(Vec<MissingItem>), ParseFailure(ParseFailure), StrictPos(usize, Metavar), NonStrictPos(usize, Metavar), ParseFailed(Option<usize>, String), GuardFailed(Option<usize>, &'static str), NoArgument(usize, Metavar), Unconsumed(usize), Ambiguity(usize, String), Suggestion(usize, Suggestion), Conflict(usize, usize), Expected(Vec<Item>, Option<usize>), OnlyOnce(usize, usize),
}

Variants§

§

NoEnv(&'static str)

Tried to consume an env variable with no fallback, variable was not set

§

ParseSome(&'static str)

User specified an error message on some

§

ParseFail(&'static str)

User asked for parser to fail explicitly

§

PureFailed(String)

pure_with failed to parse a value

§

Missing(Vec<MissingItem>)

Expected one of those values

Used internally to generate better error messages

§

ParseFailure(ParseFailure)

Parsing failed and this is the final output

§

StrictPos(usize, Metavar)

Tried to consume a strict positional argument, value was present but was not strictly positional

§

NonStrictPos(usize, Metavar)

Tried to consume a non-strict positional argument, but the value was strict

§

ParseFailed(Option<usize>, String)

Parser provided by user failed to parse a value

§

GuardFailed(Option<usize>, &'static str)

Parser provided by user failed to validate a value

§

NoArgument(usize, Metavar)

Argument requres a value but something else was passed, required: –foo given: –foo –bar –foo – bar –foo

§

Unconsumed(usize)

Parser is expected to consume all the things from the command line this item will contain an index of the unconsumed value

§

Ambiguity(usize, String)

argument is ambigoups - parser can accept it as both a set of flags and a short flag with no =

§

Suggestion(usize, Suggestion)

Suggested fixes for typos or missing input

§

Conflict(usize, usize)

Two arguments are mutually exclusive –release –dev

§

Expected(Vec<Item>, Option<usize>)

Expected one or more items in the scope, got someting else if any

§

OnlyOnce(usize, usize)

Parameter is accepted but only once

Implementations§

Source§

impl Message

Source

pub(crate) fn can_catch(&self) -> bool

Source§

impl Message

Source

pub(crate) fn combine_with(self, other: Self) -> Self

Source§

impl Message

Source

pub(crate) fn render(self, args: &State, meta: &Meta) -> ParseFailure

Trait Implementations§

Source§

impl Debug for Message

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.