pub struct Tokens { /* private fields */ }Expand description
Design tokens by name: colors with a value per appearance, numbers and font families. The default has none.
Implementations§
Source§impl Tokens
impl Tokens
Sourcepub fn color(&self, name: &str) -> Option<AdaptiveColor>
pub fn color(&self, name: &str) -> Option<AdaptiveColor>
The color named name.
Sourcepub fn set_color(&mut self, name: &str, color: AdaptiveColor)
pub fn set_color(&mut self, name: &str, color: AdaptiveColor)
Sets the color named name.
Sourcepub fn set_number(&mut self, name: &str, value: f32)
pub fn set_number(&mut self, name: &str, value: f32)
Sets the number named name.
Sourcepub fn set_font(&mut self, name: &str, family: impl Into<Arc<str>>)
pub fn set_font(&mut self, name: &str, family: impl Into<Arc<str>>)
Sets the font family named name.
Sourcepub fn get(&self, name: &str) -> Option<Token>
pub fn get(&self, name: &str) -> Option<Token>
The token named name, of any kind (a color first, as classes take
it).
Sourcepub fn colors(&self) -> impl Iterator<Item = (&str, AdaptiveColor)>
pub fn colors(&self) -> impl Iterator<Item = (&str, AdaptiveColor)>
Each color by name.
Trait Implementations§
impl StructuralPartialEq for Tokens
Auto Trait Implementations§
impl Freeze for Tokens
impl RefUnwindSafe for Tokens
impl Send for Tokens
impl Sync for Tokens
impl Unpin for Tokens
impl UnsafeUnpin for Tokens
impl UnwindSafe for Tokens
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