pub struct ThemeSnapshot {
pub colors: ThemeColors,
pub metrics: ThemeMetrics,
pub color_scheme: Option<ColorScheme>,
pub revision: u64,
/* private fields */
}Fields§
§colors: ThemeColors§metrics: ThemeMetrics§color_scheme: Option<ColorScheme>§revision: u64Implementations§
Source§impl ThemeSnapshot
impl ThemeSnapshot
pub fn from_baseline( colors: ThemeColors, metrics: ThemeMetrics, revision: u64, ) -> Self
pub fn color_by_key(&self, key: &str) -> Option<Color>
pub fn color_required(&self, key: &str) -> Color
Sourcepub fn color_token(&self, key: &str) -> Color
pub fn color_token(&self, key: &str) -> Color
Non-panicking theme token access with diagnostics + fallback behavior.
Sourcepub fn named_color(&self, key: ThemeNamedColorKey) -> Color
pub fn named_color(&self, key: ThemeNamedColorKey) -> Color
Resolves a named (non-semantic) color token used by upstream ecosystems (e.g. text-white).
pub fn metric_by_key(&self, key: &str) -> Option<Px>
pub fn metric_required(&self, key: &str) -> Px
Sourcepub fn metric_token(&self, key: &str) -> Px
pub fn metric_token(&self, key: &str) -> Px
Non-panicking theme token access with diagnostics + fallback behavior.
Trait Implementations§
Source§impl Clone for ThemeSnapshot
impl Clone for ThemeSnapshot
Source§fn clone(&self) -> ThemeSnapshot
fn clone(&self) -> ThemeSnapshot
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 moreAuto Trait Implementations§
impl Freeze for ThemeSnapshot
impl RefUnwindSafe for ThemeSnapshot
impl Send for ThemeSnapshot
impl Sync for ThemeSnapshot
impl Unpin for ThemeSnapshot
impl UnsafeUnpin for ThemeSnapshot
impl UnwindSafe for ThemeSnapshot
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