Struct yansi::Paint
[−]
[src]
pub struct Paint<T> { /* fields omitted */ }
A structure encapsulating all of the styling for a given item.
See the crate level documentation for usage information.
Methods
impl<T> Paint<T>
[src]
fn new(item: T) -> Paint<T>
Constructs a new Paint
structure that encapsulates item
. No styling
is applied.
use yansi::Paint; assert_eq!(Paint::new("hello!").to_string(), "hello!".to_string());
fn black(item: T) -> Paint<T>
Constructs a new Paint
structure that encapsulates item
with the
foreground color set to the name of this method.
use yansi::Paint; println!("This is going to be blue: {}", Paint::blue("yay!"));
fn red(item: T) -> Paint<T>
Constructs a new Paint
structure that encapsulates item
with the
foreground color set to the name of this method.
use yansi::Paint; println!("This is going to be blue: {}", Paint::blue("yay!"));
fn green(item: T) -> Paint<T>
Constructs a new Paint
structure that encapsulates item
with the
foreground color set to the name of this method.
use yansi::Paint; println!("This is going to be blue: {}", Paint::blue("yay!"));
fn yellow(item: T) -> Paint<T>
Constructs a new Paint
structure that encapsulates item
with the
foreground color set to the name of this method.
use yansi::Paint; println!("This is going to be blue: {}", Paint::blue("yay!"));
fn blue(item: T) -> Paint<T>
Constructs a new Paint
structure that encapsulates item
with the
foreground color set to the name of this method.
use yansi::Paint; println!("This is going to be blue: {}", Paint::blue("yay!"));
fn purple(item: T) -> Paint<T>
Constructs a new Paint
structure that encapsulates item
with the
foreground color set to the name of this method.
use yansi::Paint; println!("This is going to be blue: {}", Paint::blue("yay!"));
fn cyan(item: T) -> Paint<T>
Constructs a new Paint
structure that encapsulates item
with the
foreground color set to the name of this method.
use yansi::Paint; println!("This is going to be blue: {}", Paint::blue("yay!"));
fn white(item: T) -> Paint<T>
Constructs a new Paint
structure that encapsulates item
with the
foreground color set to the name of this method.
use yansi::Paint; println!("This is going to be blue: {}", Paint::blue("yay!"));
fn rgb(r: u8, g: u8, b: u8, item: T) -> Paint<T>
Constructs a new Paint
structure that encapsulates item
with the
foreground color set RGB color corresponding to r
, g
, b
.
use yansi::Paint; println!("This is going to be funky: {}", Paint::rgb(70, 130, 122, "hi!"));
fn fixed(color: u8, item: T) -> Paint<T>
Constructs a new Paint
structure that encapsulates item
with the
foreground color set to the fixed color corresponding to color
.
use yansi::Paint; println!("This is going to be funky: {}", Paint::fixed(100, "hi!"));
fn fg(self, color: Color) -> Paint<T>
Sets the foreground to color
.
use yansi::Paint; use yansi::Color::Red; println!("Red foreground: {}", Paint::new("hi!").fg(Red));
fn bg(self, color: Color) -> Paint<T>
Sets the background to color
.
use yansi::Paint; use yansi::Color::Yellow; println!("Yellow background: {}", Paint::new("hi!").bg(Yellow));
fn bold(self) -> Paint<T>
Enables the styling corresponding to the name of this method.
use yansi::Paint; println!("Red, underlined: {}", Paint::red("beep.").underline());
fn dimmed(self) -> Paint<T>
Enables the styling corresponding to the name of this method.
use yansi::Paint; println!("Red, underlined: {}", Paint::red("beep.").underline());
fn italic(self) -> Paint<T>
Enables the styling corresponding to the name of this method.
use yansi::Paint; println!("Red, underlined: {}", Paint::red("beep.").underline());
fn underline(self) -> Paint<T>
Enables the styling corresponding to the name of this method.
use yansi::Paint; println!("Red, underlined: {}", Paint::red("beep.").underline());
fn blink(self) -> Paint<T>
Enables the styling corresponding to the name of this method.
use yansi::Paint; println!("Red, underlined: {}", Paint::red("beep.").underline());
fn invert(self) -> Paint<T>
Enables the styling corresponding to the name of this method.
use yansi::Paint; println!("Red, underlined: {}", Paint::red("beep.").underline());
Enables the styling corresponding to the name of this method.
use yansi::Paint; println!("Red, underlined: {}", Paint::red("beep.").underline());
fn strikethrough(self) -> Paint<T>
Enables the styling corresponding to the name of this method.
use yansi::Paint; println!("Red, underlined: {}", Paint::red("beep.").underline());
Trait Implementations
impl<T: Default> Default for Paint<T>
[src]
impl<T: Debug> Debug for Paint<T>
[src]
impl<T: Eq> Eq for Paint<T>
[src]
impl<T: PartialEq> PartialEq for Paint<T>
[src]
fn eq(&self, __arg_0: &Paint<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Paint<T>) -> bool
This method tests for !=
.
impl<T: Ord> Ord for Paint<T>
[src]
fn cmp(&self, __arg_0: &Paint<T>) -> Ordering
This method returns an Ordering
between self
and other
. Read more
impl<T: PartialOrd> PartialOrd for Paint<T>
[src]
fn partial_cmp(&self, __arg_0: &Paint<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Paint<T>) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Paint<T>) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Paint<T>) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Paint<T>) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<T: Hash> Hash for Paint<T>
[src]
fn hash<__HT: Hasher>(&self, __arg_0: &mut __HT)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T: Copy> Copy for Paint<T>
[src]
impl<T: Clone> Clone for Paint<T>
[src]
fn clone(&self) -> Paint<T>
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