Enum palex::TokenKind[][src]

pub enum TokenKind {
    NoDash,
    OneDash,
    TwoDashes,
    AfterOneDash,
    AfterEquals,
}

The kind of the current token.

This enum acts as the state of the currently parsed argument; this is necessary because an argument can consist of multiple tokens.

Variants

NoDash

An argument that doesn't start with dashes, e.g. program.

OneDash

An argument that starts with exactly 1 dash, e.g. -foo, -V, -h=config.

TwoDashes

An argument that starts with 2 or more dashes, e.g. --version or --help=config.

AfterOneDash

An option or value of a single-dash argument, after an option has been eaten.

Example when parsing -abcd=efg,hij

abcd=efg    # OneDash
 bcd=efg    # AfterOneDash
  cd=efg    # AfterOneDash
     efg    # AfterEquals
AfterEquals

A value of an argument after the =, after the name of the argument has been eaten.

Example when parsing --abcd=efg,hij

abcd=efg,hij    # TwoDashes
     efg,hij    # AfterEquals
         hij    # AfterEquals

Trait Implementations

impl Clone for TokenKind[src]

impl Copy for TokenKind[src]

impl Debug for TokenKind[src]

impl Eq for TokenKind[src]

impl PartialEq<TokenKind> for TokenKind[src]

impl StructuralEq for TokenKind[src]

impl StructuralPartialEq for TokenKind[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.