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.
It carried the options too until makeover-layout 0.8.0 moved them onto
the field, which collapsed a Chosen { options, value } variant into
this one. makeover-immediate arrived at the same single-variant shape
on its own, from the other direction.
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.
Added 0.56.0 with makeover-layout 0.34.0.