pub struct TextStyle {
pub color: Option<Rgba>,
pub background: Option<Rgba>,
pub bold: bool,
pub italic: bool,
pub underline: Option<UnderlineDecoration>,
pub strikethrough: bool,
}Expand description
Direct styling attributes for a span of text.
Fields§
§color: Option<Rgba>Text foreground color.
background: Option<Rgba>Background highlight color.
bold: boolWhether the text is rendered in bold font weight.
italic: boolWhether the text is rendered in italic font style.
underline: Option<UnderlineDecoration>Underline decoration style if any.
strikethrough: boolStrikethrough line through the text.
Implementations§
Source§impl TextStyle
impl TextStyle
Sourcepub const fn background(self, background: Rgba) -> Self
pub const fn background(self, background: Rgba) -> Self
Sets background color.
Sourcepub const fn underline(self, underline: UnderlineDecoration) -> Self
pub const fn underline(self, underline: UnderlineDecoration) -> Self
Sets underline attribute.
Sourcepub const fn strikethrough(self) -> Self
pub const fn strikethrough(self) -> Self
Sets strikethrough attribute.
Trait Implementations§
impl Copy for TextStyle
impl Eq for TextStyle
Source§impl From<TextStyle> for StyleValue
impl From<TextStyle> for StyleValue
impl StructuralPartialEq for TextStyle
Auto Trait Implementations§
impl Freeze for TextStyle
impl RefUnwindSafe for TextStyle
impl Send for TextStyle
impl Sync for TextStyle
impl Unpin for TextStyle
impl UnsafeUnpin for TextStyle
impl UnwindSafe for TextStyle
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