#[non_exhaustive]pub enum Selecting {
OneOf,
AnyOf,
Range,
Text,
Subtree,
}Expand description
How many of a Facet’s values may be in force, and in what shape.
Five, and the fifth is what made this an enum rather than a bool. one-of,
any-of, a range and free text are the four a form vocabulary already has in
FieldKind; a tree’s selection is none of them, and describing tags as
any-of was what forced browsing to be a second mechanism beside filtering.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
OneOf
Exactly one value, and picking another replaces it.
MNW’s AI tier, whose three options are nested ranges rather than independent values, so two of them at once means nothing.
AnyOf
Any number of values, each independent of the others.
Range
A low end, a high end, or both.
Carries no values for FieldKind::Range’s reason: the ends are the
question.
Text
Whatever the user types.
Subtree
A position in a tree, edited by taking branches in and pruning branches out.
The one mode that is not reducible to the others, and the one gesture
that replaced two. Picking a value narrows the set to it and reveals
its children, so browsing a tree and filtering by it stop being separate
mechanisms with separate state. What a selection then is: a set of
branches taken and a set pruned, resolved nearest-ancestor-first, so
music in and music/synths out is sayable and no flat mode can say it.
Resolution happens in the app, and what reaches a renderer is the
Standing each drawn value ended up with. A renderer walking ancestors
itself would be a renderer that can disagree with the results beside it.
Implementations§
Source§impl Selecting
impl Selecting
Sourcepub const fn offers_values(self) -> bool
pub const fn offers_values(self) -> bool
Whether the mode picks from values the description lists.
False for Text and Range, which are the
two whose answer is not one of a set. A renderer asks this before it
looks at Facet::values, the way it asks
FieldKind::offers_options before it looks at Field::options.
Sourcepub const fn prunes(self) -> bool
pub const fn prunes(self) -> bool
Whether a value can be pruned as well as picked.
Subtree alone. Excluding a value from a flat facet is
the same fact as not picking it, so an exclude affordance there would be
a second control for a state the first one already holds.
Sourcepub const fn accumulates(self) -> bool
pub const fn accumulates(self) -> bool
Whether picking a second value keeps the first.