#[non_exhaustive]pub enum Value<'a> {
Absent,
Text(&'a str),
On(bool),
Between {
lower: &'a str,
upper: &'a str,
},
}Expand description
What a field holds now, as a renderer reads it.
The one value type every renderer draws from. Absent from a field’s description on purpose: the value is renderer state, and a description that carried it would be a second source of truth for what the user typed.
An enum rather than a bag of optional fields, for the reason Depth is
one: a checkbox holding a string is unsayable here.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Absent
Nothing yet.
Text(&'a str)
The value of anything that takes typed text, a select included: what a
select holds is the value of one of the field’s options. The options
stay the field’s, which is what keeps a Chosen { options, value }
variant from existing.
On(bool)
A checkbox, on or off.
Between
Both ends of a FieldKind::Interval, lower first.
Two values rather than one string with a separator: an interval submits under two names, so it comes back as two values, and a delimiter chosen here could appear inside either. Either end may be empty while the other stands: “over 120 BPM” is an answer, not a half-filled form.