pub struct Style { /* private fields */ }
Expand description
Text formatting styles.
§Examples
use tty_interface::{Color, Style};
let style = Color::Red.as_style().set_bold(true);
Implementations§
Source§impl Style
impl Style
Sourcepub fn set_foreground(&self, color: Color) -> Style
pub fn set_foreground(&self, color: Color) -> Style
Create a new style with the specified foreground color.
Sourcepub fn foreground(&self) -> Option<Color>
pub fn foreground(&self) -> Option<Color>
This style’s foreground color, if specified.
Sourcepub fn set_background(&self, color: Color) -> Style
pub fn set_background(&self, color: Color) -> Style
Create a new style with the specified background color.
Sourcepub fn background(&self) -> Option<Color>
pub fn background(&self) -> Option<Color>
This style’s background color, if specified.
Sourcepub fn set_bold(&self, is_bold: bool) -> Style
pub fn set_bold(&self, is_bold: bool) -> Style
Create a new style with the specified bold value.
Sourcepub fn set_italic(&self, is_italic: bool) -> Style
pub fn set_italic(&self, is_italic: bool) -> Style
Create a new style with the specified italic value.
Sourcepub fn set_underline(&self, is_underline: bool) -> Style
pub fn set_underline(&self, is_underline: bool) -> Style
Create a new style with the specified underline value.
Sourcepub fn is_underlined(&self) -> bool
pub fn is_underlined(&self) -> bool
Whether this style is underlined.
Trait Implementations§
impl Copy for Style
impl Eq for Style
impl StructuralPartialEq for Style
Auto Trait Implementations§
impl Freeze for Style
impl RefUnwindSafe for Style
impl Send for Style
impl Sync for Style
impl Unpin for Style
impl UnwindSafe for Style
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