pub struct Chalk { /* private fields */ }
Implementations§
Source§impl Chalk
For all Chalks with different color types
impl Chalk
For all Chalks with different color types
Sourcepub fn string(&self, string: &dyn ToString) -> String
pub fn string(&self, string: &dyn ToString) -> String
Formats a string using the style of the given Chalk
.
This will return the string after being formatted to the console. When using string literals, please use a reference.
For example:
chalk.yellow().string(&"this is yellow");
§Arguments
string
- The item to print out. It must implementToString
and should be a reference
§Example
use chalk_rs::Chalk;
let mut chalk = Chalk::new();
let text = chalk.yellow().string(&"this is yellow");
Sourcepub fn print(&self, string: &dyn ToString) -> String
pub fn print(&self, string: &dyn ToString) -> String
Prints a string using the style of the given chalk.
This will return the text that was outputted to the console. When using string literals, please use a reference.
For example:
chalk.yellow().print(&"this is yellow");
§Arguments
string
- The item to format and output. It must implementToString
and should be a reference.
§Example
use chalk_rs::Chalk;
let mut chalk = Chalk::new();
chalk.yellow().print(&"this is yellow");
Sourcepub fn println(&self, string: &dyn ToString) -> String
pub fn println(&self, string: &dyn ToString) -> String
Prints a string using the style of the given chalk on a new line.
This will return the text that was outputted to the console. When using string literals, please use a reference.
For example:
chalk.yellow().println(&"this is yellow");
§Arguments
string
- The item to format and output. It must implementToString
and should be a reference.
§Example
use chalk_rs::Chalk;
let mut chalk = Chalk::new();
chalk.yellow().println(&"this is yellow");
Source§impl Chalk
impl Chalk
pub fn default_color(&mut self) -> &mut Chalk
pub fn black(&mut self) -> &mut Chalk
pub fn red(&mut self) -> &mut Chalk
pub fn green(&mut self) -> &mut Chalk
pub fn yellow(&mut self) -> &mut Chalk
pub fn blue(&mut self) -> &mut Chalk
pub fn magenta(&mut self) -> &mut Chalk
pub fn cyan(&mut self) -> &mut Chalk
pub fn light_gray(&mut self) -> &mut Chalk
pub fn light_grey(&mut self) -> &mut Chalk
pub fn gray(&mut self) -> &mut Chalk
pub fn grey(&mut self) -> &mut Chalk
pub fn light_black(&mut self) -> &mut Chalk
pub fn light_red(&mut self) -> &mut Chalk
pub fn light_green(&mut self) -> &mut Chalk
pub fn light_yellow(&mut self) -> &mut Chalk
pub fn light_blue(&mut self) -> &mut Chalk
pub fn light_magenta(&mut self) -> &mut Chalk
pub fn light_cyan(&mut self) -> &mut Chalk
pub fn white(&mut self) -> &mut Chalk
pub fn ansi(&mut self, color: u8) -> &mut Chalk
pub fn rgb(&mut self, r: u8, g: u8, b: u8) -> &mut Chalk
Source§impl Chalk
impl Chalk
pub fn default_background(&mut self) -> &mut Chalk
pub fn bg_black(&mut self) -> &mut Chalk
pub fn bg_red(&mut self) -> &mut Chalk
pub fn bg_green(&mut self) -> &mut Chalk
pub fn bg_yellow(&mut self) -> &mut Chalk
pub fn bg_blue(&mut self) -> &mut Chalk
pub fn bg_magenta(&mut self) -> &mut Chalk
pub fn bg_cyan(&mut self) -> &mut Chalk
pub fn bg_light_gray(&mut self) -> &mut Chalk
pub fn bg_light_grey(&mut self) -> &mut Chalk
pub fn bg_gray(&mut self) -> &mut Chalk
pub fn bg_grey(&mut self) -> &mut Chalk
pub fn bg_light_black(&mut self) -> &mut Chalk
pub fn bg_light_red(&mut self) -> &mut Chalk
pub fn bg_light_green(&mut self) -> &mut Chalk
pub fn bg_light_yellow(&mut self) -> &mut Chalk
pub fn bg_light_blue(&mut self) -> &mut Chalk
pub fn bg_light_magenta(&mut self) -> &mut Chalk
pub fn bg_light_cyan(&mut self) -> &mut Chalk
pub fn bg_white(&mut self) -> &mut Chalk
pub fn bg_ansi(&mut self, color: u8) -> &mut Chalk
pub fn bg_rgb(&mut self, r: u8, g: u8, b: u8) -> &mut Chalk
Source§impl Chalk
impl Chalk
pub fn reset_style(&mut self) -> &mut Chalk
pub fn reset_weight(&mut self) -> &mut Chalk
pub fn bold(&mut self) -> &mut Chalk
pub fn dim(&mut self) -> &mut Chalk
pub fn italic(&mut self) -> &mut Chalk
pub fn unitalic(&mut self) -> &mut Chalk
pub fn no_underline(&mut self) -> &mut Chalk
pub fn underline(&mut self) -> &mut Chalk
pub fn double_underline(&mut self) -> &mut Chalk
pub fn stop_blink(&mut self) -> &mut Chalk
pub fn blink(&mut self) -> &mut Chalk
pub fn invert(&mut self) -> &mut Chalk
pub fn uninvert(&mut self) -> &mut Chalk
pub fn hide(&mut self) -> &mut Chalk
pub fn unhide(&mut self) -> &mut Chalk
pub fn is_normal_weight(&self) -> bool
pub fn is_bold(&self) -> bool
pub fn is_dim(&self) -> bool
pub fn is_italicized(&self) -> bool
pub fn has_underlines(&self) -> bool
pub fn is_single_underlined(&self) -> bool
pub fn is_double_underlined(&self) -> bool
pub fn is_blinking(&self) -> bool
pub fn is_inverted(&self) -> bool
pub fn num_underlines(&self) -> u8
Trait Implementations§
Source§impl Ord for Chalk
impl Ord for Chalk
Source§impl PartialOrd for Chalk
impl PartialOrd for Chalk
impl Eq for Chalk
impl StructuralPartialEq for Chalk
Auto Trait Implementations§
impl Freeze for Chalk
impl RefUnwindSafe for Chalk
impl Send for Chalk
impl Sync for Chalk
impl Unpin for Chalk
impl UnwindSafe for Chalk
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more