pub struct Style { /* private fields */ }
Expand description
A stored style that can be applied.
Implementations§
source§impl Style
impl Style
sourcepub fn from_dotted_str(s: &str) -> Style
pub fn from_dotted_str(s: &str) -> Style
Creates a style from a dotted string.
Effectively the string is split at each dot and then the
terms in between are applied. For instance red.on_blue
will
create a string that is red on blue background. 9.on_12
is
the same, but using 256 color numbers. Unknown terms are
ignored.
sourcepub fn apply_to<D>(&self, val: D) -> StyledObject<D>
pub fn apply_to<D>(&self, val: D) -> StyledObject<D>
Apply the style to something that can be displayed.
sourcepub fn force_styling(self, value: bool) -> Style
pub fn force_styling(self, value: bool) -> Style
Forces styling on or off.
This overrides the automatic detection.
sourcepub fn for_stderr(self) -> Style
pub fn for_stderr(self) -> Style
Specifies that style is applying to something being written on stderr.
sourcepub fn for_stdout(self) -> Style
pub fn for_stdout(self) -> Style
Specifies that style is applying to something being written on stdout.
This is the default behaviour.