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 Forget for Tokens
impl Freeze for Tokenswhere
*const u8 is !null: Freeze,
PhantomData<(Box<str>, AdaptiveColor)>: Freeze,
PhantomData<(Box<str>, f32)>: Freeze,
PhantomData<(Box<str>, Arc<str>)>: Freeze,
impl Move for Tokens
impl RefUnwindSafe for Tokens
impl Send for Tokens
impl Sync for Tokens
impl Unpin for Tokens
impl UnsafeUnpin for Tokenswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<(Box<str>, AdaptiveColor)>: UnsafeUnpin,
PhantomData<(Box<str>, f32)>: UnsafeUnpin,
PhantomData<(Box<str>, Arc<str>)>: UnsafeUnpin,
impl UnwindSafe for Tokenswhere
HashMap<Box<str>, AdaptiveColor, FxBuildHasher>: UnwindSafe,
HashMap<Box<str>, f32, FxBuildHasher>: UnwindSafe,
HashMap<Box<str>, Arc<str>, FxBuildHasher>: UnwindSafe,
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