#[non_exhaustive]pub enum BuiltInTheme {
Slate,
Charcoal,
Frost,
Paper,
}Expand description
One of the four built-in elegance themes, as a typed enum.
Useful as the bound value for ThemeSwitcher or
anywhere you want to remember a theme choice without stringly-typing it.
Marked #[non_exhaustive] so future built-in additions won’t break
exhaustive matches in downstream code.
let choice = BuiltInTheme::Frost;
let theme = choice.theme();
assert_eq!(choice.label(), "Frost");
assert!(!theme.palette.is_dark);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.
Slate
Theme::slate — cool dark blue. The default.
Charcoal
Theme::charcoal — neutral dark grey.
Frost
Theme::frost — light counterpart to slate.
Paper
Theme::paper — light counterpart to charcoal.
Implementations§
Source§impl BuiltInTheme
impl BuiltInTheme
Sourcepub const fn label(self) -> &'static str
pub const fn label(self) -> &'static str
Display label used by ThemeSwitcher.
Sourcepub const fn all() -> [BuiltInTheme; 4]
pub const fn all() -> [BuiltInTheme; 4]
All four built-in themes in their canonical display order: dark variants first (Slate, Charcoal), then light (Frost, Paper).
Trait Implementations§
Source§impl Clone for BuiltInTheme
impl Clone for BuiltInTheme
Source§fn clone(&self) -> BuiltInTheme
fn clone(&self) -> BuiltInTheme
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BuiltInTheme
impl Debug for BuiltInTheme
Source§impl Default for BuiltInTheme
impl Default for BuiltInTheme
Source§fn default() -> BuiltInTheme
fn default() -> BuiltInTheme
Returns the “default value” for a type. Read more
Source§impl Hash for BuiltInTheme
impl Hash for BuiltInTheme
Source§impl PartialEq for BuiltInTheme
impl PartialEq for BuiltInTheme
impl Copy for BuiltInTheme
impl Eq for BuiltInTheme
impl StructuralPartialEq for BuiltInTheme
Auto Trait Implementations§
impl Freeze for BuiltInTheme
impl RefUnwindSafe for BuiltInTheme
impl Send for BuiltInTheme
impl Sync for BuiltInTheme
impl Unpin for BuiltInTheme
impl UnsafeUnpin for BuiltInTheme
impl UnwindSafe for BuiltInTheme
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more