Skip to main content

Selecting

Enum Selecting 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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

Source

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.

Source

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.

Source

pub const fn accumulates(self) -> bool

Whether picking a second value keeps the first.

Trait Implementations§

Source§

impl Clone for Selecting

Source§

fn clone(&self) -> Selecting

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Selecting

Source§

impl Debug for Selecting

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Selecting

Source§

impl Hash for Selecting

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Selecting

Source§

fn eq(&self, other: &Selecting) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Selecting

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.