pub enum Value<'a> {
Absent,
Text(&'a str),
On(bool),
Between {
lower: &'a str,
upper: &'a str,
},
}Expand description
What the field currently holds.
An enum rather than a bag of optional fields, on the same reasoning
makeover_layout::Depth is one: a checkbox holding a string is unsayable
here, where a struct would let it be said and then have to cope.
Variants§
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 Field::options’s
Choices.
The options are the field’s and never this type’s, which is what keeps
a Chosen { options, value } variant from existing.
makeover-immediate carries the same single-variant shape.
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, for
makeover_layout::Field::upper_name’s reason one level down: an
interval submits under two names, so it comes back as two values, and a
delimiter this crate owned could appear inside either of them.
Either end may be empty while the other stands. “Over 120 BPM” is a lower end and no upper one, and it is an answer rather than a half-filled form.