pub struct Style { /* private fields */ }
Expand description
A stored style that can be applied.
Implementations
sourceimpl 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. 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 detection from clicolors-control
.
pub fn black(self) -> Style
pub fn red(self) -> Style
pub fn green(self) -> Style
pub fn yellow(self) -> Style
pub fn blue(self) -> Style
pub fn magenta(self) -> Style
pub fn cyan(self) -> Style
pub fn white(self) -> Style
pub fn on_black(self) -> Style
pub fn on_red(self) -> Style
pub fn on_green(self) -> Style
pub fn on_yellow(self) -> Style
pub fn on_blue(self) -> Style
pub fn on_magenta(self) -> Style
pub fn on_cyan(self) -> Style
pub fn on_white(self) -> Style
pub fn bold(self) -> Style
pub fn dim(self) -> Style
pub fn italic(self) -> Style
pub fn underlined(self) -> Style
pub fn blink(self) -> Style
pub fn reverse(self) -> Style
Trait Implementations
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