Struct usage::parse::arg::Arg

source ·
pub struct Arg {
    pub name: String,
    pub help: Option<String>,
    pub long_help: Option<String>,
    pub required: bool,
    pub var: bool,
    pub var_min: Option<i64>,
    pub var_max: Option<i64>,
    pub hide: bool,
    pub default: Option<String>,
}

Fields§

§name: String§help: Option<String>§long_help: Option<String>§required: bool§var: bool§var_min: Option<i64>§var_max: Option<i64>§hide: bool§default: Option<String>

Implementations§

source§

impl Arg

source

pub fn usage(&self) -> String

Trait Implementations§

source§

impl Debug for Arg

source§

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

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

impl Default for Arg

source§

fn default() -> Arg

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

impl From<&Arg> for Arg

source§

fn from(arg: &Arg) -> Self

Converts to this type from the input type.
source§

impl From<&Arg> for Arg

source§

fn from(arg: &Arg) -> Self

Converts to this type from the input type.
source§

impl From<&Arg> for KdlNode

source§

fn from(arg: &Arg) -> Self

Converts to this type from the input type.
source§

impl From<&str> for Arg

source§

fn from(input: &str) -> Self

Converts to this type from the input type.
source§

impl FromStr for Arg

§

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 Arg

§

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 Arg

§

impl Send for Arg

§

impl Sync for Arg

§

impl Unpin for Arg

§

impl UnwindSafe for Arg

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.