Struct combu::flag::Flag[][src]

pub struct Flag {
    pub name: String,
    pub description: String,
    pub short_alias: Vector<char>,
    pub long_alias: Vector<String>,
    pub default_value: FlagValue,
    pub flag_type: FlagType,
}
Expand description

Struct for Flag setting’s information

Fields

name: String

This flag’s name

description: String

This flag’s description

short_alias: Vector<char>

Vector of this flag’s short alias

long_alias: Vector<String>

Vector of this flag’s long alias

default_value: FlagValue

This flag’s default value

flag_type: FlagType

This flag’s flag_type

Implementations

Creates a new instance of Flag

Builds a new instance of Flags with all options.

Creates a new instance of Flag with name

Creates a new instance of Flag with name and type

Creates a new instance of bool Flag

Creates a new instance of string Flag

Creates a new instance of int Flag

Creates a new instance of float Flag

Add an short alias to this Flag

Add an alias to this Flag

Set this flag’s default value

Set this flag’s description

Returns true if &self’s name equals name of arg.

Returns true is alias equals one of short alias

Returns positions alias in aliases matches one of short alias.

Returns true is alias equals one of long alias

Get this Flag’s name’s clone

Derives this Flag’s value from arg Alias of self.flag_type.get_value_from_string(arg)

Derives this Flag’s value in case of no value Alias of self.flag_type.get_value_if_no_value()

Add help for this flag to append_to. name_and_alias_min_width means min width of name and alias’ field.
Flagに対するヘルプをappend_toに追加する。nameとalias表示部分のずれをある程度吸収できるようにその部分の最小幅をname_and_alias_min_widthで指定する

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Performs the conversion.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.