Enum tinted_builder_rust::Scheme
source · #[non_exhaustive]pub enum Scheme {
Base16(Base16Scheme),
Base24(Base16Scheme),
}Expand description
Add tinted-builder library test since tinted-builder-rust is exporting the structs
use tinted_builder_rust::{Scheme, Template};
let template = String::from(r#"/* Some CSS file with {{scheme-name}} theme */
.someCssSelector { background-color: #{{base00-hex}} }
.someOtherCssSelector { background-color: #{{base0F-hex}} }"#);
let scheme_str = r#"system: "base16"
name: "UwUnicorn"
author: "Fernando Marques (https://github.com/RakkiUwU) and Gabriel Fontes (https://github.com/Misterio77)"
variant: "dark"
palette:
base00: "241b26"
base01: "2f2a3f"
base02: "46354a"
base03: "6c3cb2"
base04: "7e5f83"
base05: "eed5d9"
base06: "d9c2c6"
base07: "e4ccd0"
base08: "877bb6"
base09: "de5b44"
base0A: "a84a73"
base0B: "c965bf"
base0C: "9c5fce"
base0D: "6a9eb5"
base0E: "78a38f"
base0F: "a3a079""#;
let scheme = Scheme::Base16(serde_yaml::from_str(&scheme_str).unwrap());
let template = Template::new(template, scheme);
let output = template
.render()
.unwrap();
assert_eq!(output, r#"/* Some CSS file with UwUnicorn theme */
.someCssSelector { background-color: #241b26 }
.someOtherCssSelector { background-color: #a3a079 }"#);Enum representing schemes for different scheme systems. This enum is non-exhaustive, meaning additional variants may be added in future versions without it being considered a breaking change.
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.
Base16(Base16Scheme)
Base16 variant with Base16Scheme deserialized content.
Base24(Base16Scheme)
Base24 variant with Base16Scheme deserialized content. Base16Scheme is built to support basic supersets of Base16 schemes.
Implementations§
source§impl Scheme
impl Scheme
pub fn get_scheme_system(&self) -> SchemeSystem
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Scheme
impl RefUnwindSafe for Scheme
impl Send for Scheme
impl Sync for Scheme
impl Unpin for Scheme
impl UnwindSafe for Scheme
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)