Skip to main content

ThemeTokens

Struct ThemeTokens 

Source
pub struct ThemeTokens { /* private fields */ }
Expand description

Complete compiled cross-platform design token bundle passed across all UI components.

Implementations§

Source§

impl ThemeTokens

Complete 17-scheme x 2-mode deterministic token resolver backed by compile-time LUTs.

Source

pub fn resolve_static(key: ThemeKey) -> &'static Self

Resolves a zero-copy 'static reference to the ThemeTokens entry for key in O(1).

§Arguments
  • ThemeKey - Compact 2-byte (DesignScheme, ThemeMode) lookup key.
§Returns
  • &'static Self - Static reference into THEME_TOKENS_LUT.
Source

pub const fn key(&self) -> ThemeKey

Returns the compact 2-byte ThemeKey identifying this token bundle.

§Arguments
  • &Self - Active theme tokens.
§Returns
  • ThemeKey - Compact 2-byte (scheme, mode) key.
Source

pub fn resolve(scheme: DesignScheme, mode: ThemeMode) -> Self

Resolves complete ThemeTokens for any (DesignScheme, ThemeMode) pair via O(1) static LUT lookup.

§Arguments
  • DesignScheme - Target design language.
  • ThemeMode - Light or Dark appearance.
§Returns
  • Self - Compiled zero-allocation token bundle.
Source

pub fn card_style(&self) -> Style

Returns a standard card surface Style honoring the active scheme and theme.

§Arguments
  • &Self - Active theme tokens.
§Returns
  • Style - Compiled card box style.
Source§

impl ThemeTokens

Source

pub fn get_scheme(&self) -> DesignScheme

Source

pub fn get_mut_scheme(&mut self) -> &mut DesignScheme

Source

pub fn set_scheme(&mut self, val: DesignScheme) -> &mut Self

Source

pub fn get_mode(&self) -> ThemeMode

Source

pub fn get_mut_mode(&mut self) -> &mut ThemeMode

Source

pub fn set_mode(&mut self, val: ThemeMode) -> &mut Self

Source

pub fn get_palette(&self) -> ThemePalette

Source

pub fn get_mut_palette(&mut self) -> &mut ThemePalette

Source

pub fn set_palette(&mut self, val: ThemePalette) -> &mut Self

Source

pub fn get_geometry(&self) -> ThemeGeometry

Source

pub fn get_mut_geometry(&mut self) -> &mut ThemeGeometry

Source

pub fn set_geometry(&mut self, val: ThemeGeometry) -> &mut Self

Trait Implementations§

Source§

impl Clone for ThemeTokens

Source§

fn clone(&self) -> Self

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 ThemeTokens

Source§

impl Debug for ThemeTokens

Source§

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

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

impl Default for ThemeTokens

Default theme tokens resolving from the active compile-time feature scheme in Light mode.

Source§

fn default() -> Self

Creates default ThemeTokens.

§Returns
  • Self - Resolved design tokens.
Source§

impl PartialEq for ThemeTokens

Source§

fn eq(&self, other: &Self) -> 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 ThemeTokens

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.