pub struct InputSectionElem {
    pub id: String,
    pub label: String,
    pub optional: bool,
    pub default: Option<String>,
    pub input: Input,
}
Expand description

The properties of an input element. This needs to be passed around, so it’s broken out of the SectionElem input.

Fields

id: String

The input’s ID, which can be used to reference its value later for interpolation in a formatted report.

label: String

The label for the input. This does not support Markdown.

optional: bool

Whether or not the input is optional.

default: Option<String>

The default value for the input. If the input is optional, this will be the value used for interpolation. If the input is not optional, this will be the default, which means it will be left as this if the user doesn’t fill it in. If a value should be provided, you should make it mandatory and set a default, as optional fields should be assumed to potentially not contain any value (even though they always will if a default value is provided).

If the input is a Select, this must correspond to an entry in options.

input: Input

The actual properties of the input (unique depending on the input’s type).

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

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

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.