Struct usage::parse::flag::Flag

source ·
pub struct Flag {
    pub name: String,
    pub help: Option<String>,
    pub long_help: Option<String>,
    pub short: Vec<char>,
    pub long: Vec<String>,
    pub required: bool,
    pub var: bool,
    pub hide: bool,
    pub global: bool,
    pub count: bool,
    pub arg: Option<Arg>,
}

Fields§

§name: String§help: Option<String>§long_help: Option<String>§short: Vec<char>§long: Vec<String>§required: bool§var: bool§hide: bool§global: bool§count: bool§arg: Option<Arg>

Implementations§

source§

impl Flag

source

pub fn usage(&self) -> String

Trait Implementations§

source§

impl Debug for Flag

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for Flag

source§

fn default() -> Flag

Returns the “default value” for a type. Read more
source§

impl From<&Arg> for Flag

source§

fn from(c: &Arg) -> Self

Converts to this type from the input type.
source§

impl From<&Flag> for Arg

source§

fn from(flag: &Flag) -> Self

Converts to this type from the input type.
source§

impl From<&Flag> for KdlNode

source§

fn from(flag: &Flag) -> KdlNode

Converts to this type from the input type.
source§

impl FromStr for Flag

§

type Err = UsageErr

The associated error which can be returned from parsing.
source§

fn from_str(input: &str) -> Result<Self, UsageErr>

Parses a string s to return a value of this type. Read more
source§

impl TryFrom<&KdlNode> for Flag

§

type Error = UsageErr

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

fn try_from(node: &KdlNode) -> Result<Self, UsageErr>

Performs the conversion.

Auto Trait Implementations§

§

impl RefUnwindSafe for Flag

§

impl Send for Flag

§

impl Sync for Flag

§

impl Unpin for Flag

§

impl UnwindSafe for Flag

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>,

§

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>,

§

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.