#[non_exhaustive]pub struct ThemeChoice<'a> {
pub id: &'a str,
pub name: &'a str,
pub variant: ThemeVariant,
pub contrast: Contrast,
}Expand description
One theme, as a picker offers it.
Four facts where a Choice has two, and the two extra ones are why this
is its own type rather than options with the variant folded into the label.
Both are facts the theme layer resolved and neither survives being written
into a string: a group is structure and a badge is a second column.
§No unavailable
Choice::unavailable’s counterpart is absent for its own sibling’s
reason. A theme that is installed can be picked, and a theme that is not
installed is not in the list. There is no third state for a reason to
explain.
#[non_exhaustive] from birth, so a new member costs no call site.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: &'a strWhat is submitted, and what the app stores.
name: &'a strWhat is read.
variant: ThemeVariantWhich group it belongs to.
contrast: ContrastHow legible its muted text measured.
Implementations§
Source§impl<'a> ThemeChoice<'a>
impl<'a> ThemeChoice<'a>
Sourcepub const fn new(
id: &'a str,
name: &'a str,
variant: ThemeVariant,
contrast: Contrast,
) -> Self
pub const fn new( id: &'a str, name: &'a str, variant: ThemeVariant, contrast: Contrast, ) -> Self
A theme, with everything a picker needs to place and mark it.
Every fact is an argument and none is a builder, which is the opposite
of Choice’s arrangement and is deliberate: a theme missing its
variant has no group to sit in and a theme missing its tier has no badge
to draw, so both are the control rather than embellishments on it. The
same reasoning Field::range applies to its bounds.
Trait Implementations§
Source§impl<'a> Clone for ThemeChoice<'a>
impl<'a> Clone for ThemeChoice<'a>
Source§fn clone(&self) -> ThemeChoice<'a>
fn clone(&self) -> ThemeChoice<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more