Enum term_painter::Attr
[−]
[src]
pub enum Attr { Plain, Bold, Dim, Underline, Blink, Reverse, Secure, }
Lists possible attributes. It implements ToStyle
so it's possible to call
ToStyle
's methods directly on a Attr
variant like:
println!("{}", Attr::Bold.fg(Color::Red).paint("Red and bold"));
For more information about enum variants, see term::Attr
Documentation.
Variants
Plain
Just default style
Bold
Dim
Underline
Blink
Reverse
Secure
Trait Implementations
impl Eq for Attr
[src]
impl PartialEq for Attr
[src]
fn eq(&self, __arg_0: &Attr) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl Clone for Attr
[src]
fn clone(&self) -> Attr
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Copy for Attr
[src]
impl Debug for Attr
[src]
impl ToStyle for Attr
[src]
fn to_style(self) -> Style
Returns a Style with default values and the self
attribute enabled.
fn fg(self, c: Color) -> Style
Sets the foreground (text) color.
fn bg(self, c: Color) -> Style
Sets the background color.
fn bold(self) -> Style
Makes the text bold.
fn dim(self) -> Style
Dim mode.
fn underline(self) -> Style
Underlines the text.
fn not_underline(self) -> Style
Removes underline-attribute.
fn blink(self) -> Style
Underlines the text.
fn reverse(self) -> Style
Underlines the text.
fn secure(self) -> Style
Secure mode.
fn paint<T>(&self, obj: T) -> Painted<T> where Self: Clone
Wraps the style specified in self
and something of arbitrary type into a Painted
. When Painted
is printed it will print the arbitrary something with the given style. Read more
fn with<F, R>(&self, f: F) -> R where F: FnOnce() -> R, Self: Clone
Executes the given function, applying the style information before calling it and resetting after it finished. Read more