Struct console::StyledObject
source · pub struct StyledObject<D> { /* private fields */ }
Expand description
A formatting wrapper that can be styled for a terminal.
Implementations§
source§impl<D> StyledObject<D>
impl<D> StyledObject<D>
sourcepub fn force_styling(self, value: bool) -> StyledObject<D>
pub fn force_styling(self, value: bool) -> StyledObject<D>
Forces styling on or off.
This overrides the automatic detection.
sourcepub fn for_stderr(self) -> StyledObject<D>
pub fn for_stderr(self) -> StyledObject<D>
Specifies that style is applying to something being written on stderr
sourcepub fn for_stdout(self) -> StyledObject<D>
pub fn for_stdout(self) -> StyledObject<D>
Specifies that style is applying to something being written on stdout
This is the default
sourcepub fn fg(self, color: Color) -> StyledObject<D>
pub fn fg(self, color: Color) -> StyledObject<D>
Sets a foreground color.
sourcepub fn bg(self, color: Color) -> StyledObject<D>
pub fn bg(self, color: Color) -> StyledObject<D>
Sets a background color.
sourcepub fn attr(self, attr: Attribute) -> StyledObject<D>
pub fn attr(self, attr: Attribute) -> StyledObject<D>
Adds a attr.
pub fn black(self) -> StyledObject<D>
pub fn red(self) -> StyledObject<D>
pub fn green(self) -> StyledObject<D>
pub fn yellow(self) -> StyledObject<D>
pub fn blue(self) -> StyledObject<D>
pub fn magenta(self) -> StyledObject<D>
pub fn cyan(self) -> StyledObject<D>
pub fn white(self) -> StyledObject<D>
pub fn color256(self, color: u8) -> StyledObject<D>
pub fn bright(self) -> StyledObject<D>
pub fn on_black(self) -> StyledObject<D>
pub fn on_red(self) -> StyledObject<D>
pub fn on_green(self) -> StyledObject<D>
pub fn on_yellow(self) -> StyledObject<D>
pub fn on_blue(self) -> StyledObject<D>
pub fn on_magenta(self) -> StyledObject<D>
pub fn on_cyan(self) -> StyledObject<D>
pub fn on_white(self) -> StyledObject<D>
pub fn on_color256(self, color: u8) -> StyledObject<D>
pub fn on_bright(self) -> StyledObject<D>
pub fn bold(self) -> StyledObject<D>
pub fn dim(self) -> StyledObject<D>
pub fn italic(self) -> StyledObject<D>
pub fn underlined(self) -> StyledObject<D>
pub fn blink(self) -> StyledObject<D>
pub fn blink_fast(self) -> StyledObject<D>
pub fn reverse(self) -> StyledObject<D>
pub fn strikethrough(self) -> StyledObject<D>
Trait Implementations§
source§impl<D: Binary> Binary for StyledObject<D>
impl<D: Binary> Binary for StyledObject<D>
source§impl<D: Clone> Clone for StyledObject<D>
impl<D: Clone> Clone for StyledObject<D>
source§fn clone(&self) -> StyledObject<D>
fn clone(&self) -> StyledObject<D>
Returns a copy 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 more