pub struct StyleAttributes {
pub fg: Option<ColorDef>,
pub bg: Option<ColorDef>,
pub bold: Option<bool>,
pub dim: Option<bool>,
pub italic: Option<bool>,
pub underline: Option<bool>,
pub blink: Option<bool>,
pub reverse: Option<bool>,
pub hidden: Option<bool>,
pub strikethrough: Option<bool>,
}Expand description
Parsed style attributes from YAML.
All fields are optional to support both full definitions and partial overrides.
When merging, Some values override, None values preserve the base.
Fields§
§fg: Option<ColorDef>Foreground (text) color.
bg: Option<ColorDef>Background color.
bold: Option<bool>Bold text.
dim: Option<bool>Dimmed/faded text.
italic: Option<bool>Italic text.
underline: Option<bool>Underlined text.
blink: Option<bool>Blinking text (limited terminal support).
reverse: Option<bool>Swap fg/bg colors.
Hidden text.
strikethrough: Option<bool>Strikethrough text.
Implementations§
Source§impl StyleAttributes
impl StyleAttributes
Sourcepub fn parse_mapping(
map: &Mapping,
style_name: &str,
) -> Result<Self, StylesheetError>
pub fn parse_mapping( map: &Mapping, style_name: &str, ) -> Result<Self, StylesheetError>
Parses attributes from a YAML mapping.
Ignores light and dark keys (handled separately by the parser).
Sourcepub fn merge(&self, other: &StyleAttributes) -> StyleAttributes
pub fn merge(&self, other: &StyleAttributes) -> StyleAttributes
Merges another set of attributes onto this one.
Some values in other override values in self.
None values in other preserve values in self.
Returns a new StyleAttributes with the merged result.
Trait Implementations§
Source§impl Clone for StyleAttributes
impl Clone for StyleAttributes
Source§fn clone(&self) -> StyleAttributes
fn clone(&self) -> StyleAttributes
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 moreSource§impl Debug for StyleAttributes
impl Debug for StyleAttributes
Source§impl Default for StyleAttributes
impl Default for StyleAttributes
Source§fn default() -> StyleAttributes
fn default() -> StyleAttributes
Returns the “default value” for a type. Read more
Source§impl PartialEq for StyleAttributes
impl PartialEq for StyleAttributes
impl Eq for StyleAttributes
impl StructuralPartialEq for StyleAttributes
Auto Trait Implementations§
impl Freeze for StyleAttributes
impl RefUnwindSafe for StyleAttributes
impl Send for StyleAttributes
impl Sync for StyleAttributes
impl Unpin for StyleAttributes
impl UnwindSafe for StyleAttributes
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.