Struct combu::flag::Flag

source · []
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()

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

Converts to this type from the input type.

Converts to this type from the input type.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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)

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.