Struct term_painter::Style
[−]
[src]
pub struct Style { pub fg: Color, pub bg: Color, // some fields omitted }
Saves all properties of a style. Implements ToStyle
, so you can call
style modifiers on it.
Fields
fg: Color
bg: Color
Methods
impl Style
[src]
fn get_bold(&self) -> Option<bool>
fn set_bold(&mut self, v: Option<bool>)
fn get_dim(&self) -> Option<bool>
fn set_dim(&mut self, v: Option<bool>)
fn get_underline(&self) -> Option<bool>
fn set_underline(&mut self, v: Option<bool>)
fn get_blink(&self) -> Option<bool>
fn set_blink(&mut self, v: Option<bool>)
fn get_reverse(&self) -> Option<bool>
fn set_reverse(&mut self, v: Option<bool>)
fn get_secure(&self) -> Option<bool>
fn set_secure(&mut self, v: Option<bool>)
Trait Implementations
impl Debug for Style
[src]
impl Copy for Style
[src]
impl Clone for Style
[src]
fn clone(&self) -> Style
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 PartialEq for Style
[src]
fn eq(&self, __arg_0: &Style) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Style) -> bool
This method tests for !=
.
impl Eq for Style
[src]
impl Default for Style
[src]
impl ToStyle for Style
[src]
fn to_style(self) -> Style
Dummy implementation that just returns self
.
fn to_mapped_style<F>(self, func: F) -> Style where
F: FnOnce(&mut Style),
F: FnOnce(&mut Style),
Convenience method for modifying the style before it's returned.
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,
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,
F: FnOnce() -> R,
Self: Clone,
Executes the given function, applying the style information before calling it and resetting after it finished. Read more