Skip to main content

ConfigKind

Enum ConfigKind 

Source
pub enum ConfigKind {
    Int {
        min: i64,
        max: i64,
        unit: Option<String>,
    },
    Float {
        min: f64,
        max: f64,
        unit: Option<String>,
    },
    Bool,
    Text {
        max_len: usize,
    },
    CsvInt {
        min: i64,
        max: i64,
    },
    Enum {
        options: Vec<String>,
    },
    Secret,
}
Expand description

参数型与界(校验单源:界面编辑、CLI 写档、导入档案包共用同一条 ConfigField::validate)。

Variants§

§

Int

整数(含界;unit 供界面显单位,如「秒」「手」)。

Fields

§min: i64
§max: i64
§

Float

浮点(含界;必须有限值)。

Fields

§min: f64
§max: f64
§

Bool

布尔(字面量 true/false)。

§

Text

文本(长度上限,按字符计)。

Fields

§max_len: usize
§

CsvInt

逗号并列的整数表(如 K 线周期秒表 60,300,900)。

Fields

§min: i64
§max: i64
§

Enum

单选枚举。

Fields

§options: Vec<String>
§

Secret

秘面引用(值在密库,档案只落引用行,界面永不回显值)。

Trait Implementations§

Source§

impl Clone for ConfigKind

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ConfigKind

Source§

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

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

impl PartialEq for ConfigKind

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ConfigKind

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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.