[][src]Struct flood_tide::Opt

pub struct Opt<'a> {
    pub sho: u8,
    pub lon: &'a str,
    pub has: Arg,
    pub num: OptNum,
}

Record type of opt ary table

Examples

#[cfg(feature = "option_argument")]
{
    use flood_tide::Arg;
    use flood_tide::Lex;
    use flood_tide::Opt;
    use flood_tide::OptNum;
    
    #[rustfmt::skip]
    #[repr(u8)]
    #[derive(Debug, PartialEq)]
    enum CmdOP { A = 1, Barn, Eat, };
    impl CmdOP { pub const fn to(self) -> OptNum { self as OptNum } }
    
    #[rustfmt::skip]
    const OPT_ARY: [Opt;3] = [
        Opt { sho: b'a', lon: "",     has: Arg::No,  num: CmdOP::A.to(), },
        Opt { sho: b'b', lon: "barn", has: Arg::No,  num: CmdOP::Barn.to(), },
        Opt { sho: 0u8,  lon: "eat",  has: Arg::Yes, num: CmdOP::Eat.to(), },
    ];
}

Fields

sho: u8

short name

lon: &'a str

long name

has: Arg

has arg / option argument

num: OptNum

uniq number

Trait Implementations

impl<'a> Clone for Opt<'a>[src]

impl<'a> Copy for Opt<'a>[src]

impl<'a> Debug for Opt<'a>[src]

impl<'a> PartialEq<Opt<'a>> for Opt<'a>[src]

impl<'a> StructuralPartialEq for Opt<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Opt<'a>[src]

impl<'a> Send for Opt<'a>[src]

impl<'a> Sync for Opt<'a>[src]

impl<'a> Unpin for Opt<'a>[src]

impl<'a> UnwindSafe for Opt<'a>[src]

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.