pub struct Schema {
pub schema_version: u32,
pub active: String,
pub themes: BTreeMap<String, Palette>,
pub theme_families: BTreeMap<String, String>,
pub wallpaper_options: BTreeMap<String, Vec<String>>,
pub paths: Paths,
pub palette: Palette,
}Fields§
§schema_version: u32§active: Stringname of the theme used when a caller doesn’t ask for one
themes: BTreeMap<String, Palette>every theme, keyed by slug
theme_families: BTreeMap<String, String>Family name for each embedded theme, preserved from its source directory instead of being guessed from its slug by consumers.
wallpaper_options: BTreeMap<String, Vec<String>>Governed wallpaper resources that can be paired with each theme.
paths: Paths§palette: PaletteThe resolved active theme — filled in by load, not present in
the JSON. Kept as a field (not a method) so schema::load().palette
keeps compiling for pre-v2 callers.
Implementations§
Source§impl Schema
impl Schema
Sourcepub fn theme(&self, name: &str) -> Option<&Palette>
pub fn theme(&self, name: &str) -> Option<&Palette>
A theme by slug, or None if it isn’t defined.
Sourcepub fn active_theme(&self) -> &Palette
pub fn active_theme(&self) -> &Palette
The active theme (same value as self.palette).
Sourcepub fn theme_names(&self) -> impl Iterator<Item = &str>
pub fn theme_names(&self) -> impl Iterator<Item = &str>
All theme slugs, sorted.
Sourcepub fn theme_family(&self, name: &str) -> Option<&str>
pub fn theme_family(&self, name: &str) -> Option<&str>
The source family for an embedded theme, if one was recorded.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Schema
impl<'de> Deserialize<'de> for Schema
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Schema, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Schema, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnsafeUnpin for Schema
impl UnwindSafe for Schema
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