Struct tty_interface::Style
source · [−]pub struct Style { /* private fields */ }Expand description
Text formatting styles.
Examples
use tty_interface::{Color, Style};
let style = Style::default().set_foreground(Color::Red).set_bold(true);Implementations
sourceimpl 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 StructuralEq for Style
impl StructuralPartialEq for Style
Auto Trait Implementations
impl RefUnwindSafe for Style
impl Send for Style
impl Sync for Style
impl Unpin for Style
impl UnwindSafe for Style
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more