Expand description
Enum for storage FlagValue フラグの値を保持するためのEnum
Variants
Bool(bool)
Variant shows bool flag value Bool値保存用
String(String)
Variant shows string flag value String値保存用
Int(isize)
Variant shows int flag value Int値保存用
Float(f64)
Variant for float flag value Float値保存用
Invalid(String)
Variant for invalid flag value 間違った値が指定されていた時にString値で指定されたフラグ値の保存用
None
Variant for no flag value None表現用
Implementations
sourceimpl FlagValue
impl FlagValue
sourcepub fn get_type(&self) -> Option<&FlagType>
pub fn get_type(&self) -> Option<&FlagType>
Get &self’s corresponding type of FlagType. Returns None if &self is a invalid flag value. FlagValueに対応するFlagTypeを取得する
sourcepub fn is_type(&self, flag_type: &FlagType) -> bool
pub fn is_type(&self, flag_type: &FlagType) -> bool
Returns true if &self’s FlagType is flag_type.
sourcepub fn get_bool_value_from_string(val: String) -> FlagValue
pub fn get_bool_value_from_string(val: String) -> FlagValue
Gets bool FlagValue from string
sourcepub fn get_string(self) -> String
pub fn get_string(self) -> String
Gets string from self
sourcepub fn is_bool_true(&self) -> bool
pub fn is_bool_true(&self) -> bool
Returns true if self is FlagValue::Bool(true)
sourcepub fn get_bool(&self) -> Option<bool>
pub fn get_bool(&self) -> Option<bool>
Returns inner bool value. If self is not FlagValue::Bool(val), returns None.
sourcepub fn get_bool_unwrap(&self) -> bool
pub fn get_bool_unwrap(&self) -> bool
Returns inner bool value. If self is not FlagValue::Bool(val), panic will occur.
sourcepub fn get_int(&self) -> Option<isize>
pub fn get_int(&self) -> Option<isize>
Returns inner isize value. If self is not FlagValue::Bool(val), returns None.
sourcepub fn get_int_unwrap(&self) -> isize
pub fn get_int_unwrap(&self) -> isize
Returns inner isize value. If self is not FlagValue::Bool(val), panic will occur.
Trait Implementations
sourceimpl PartialOrd<FlagValue> for FlagValue
impl PartialOrd<FlagValue> for FlagValue
sourcefn partial_cmp(&self, other: &FlagValue) -> Option<Ordering>
fn partial_cmp(&self, other: &FlagValue) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more