pub struct ColoredString { /* private fields */ }Expand description
A string with ANSI styling effects applied
Created via the Colorize trait. When displayed, outputs the string wrapped in
the appropriate ANSI escape sequences.
§Examples
use tinycolor::Colorize;
let styled = "Hello".bold().italic();
println!("{}", styled); // Prints with bold+italic styling§Feature Flags
serde: Enables serialization/deserialization support
Trait Implementations§
Source§impl Clone for ColoredString
impl Clone for ColoredString
Source§fn clone(&self) -> ColoredString
fn clone(&self) -> ColoredString
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Colorize for ColoredString
impl Colorize for ColoredString
fn bold(&self) -> ColoredString
fn dim(&self) -> ColoredString
fn italic(&self) -> ColoredString
fn underline(&self) -> ColoredString
fn blink(&self) -> ColoredString
fn invert(&self) -> ColoredString
fn strikethrough(&self) -> ColoredString
fn black(&self) -> ColoredString
fn red(&self) -> ColoredString
fn green(&self) -> ColoredString
fn yellow(&self) -> ColoredString
fn blue(&self) -> ColoredString
fn magenta(&self) -> ColoredString
fn cyan(&self) -> ColoredString
fn white(&self) -> ColoredString
fn rgb(&self, r: u8, g: u8, b: u8) -> ColoredString
fn on_black(&self) -> ColoredString
fn on_red(&self) -> ColoredString
fn on_green(&self) -> ColoredString
fn on_yellow(&self) -> ColoredString
fn on_blue(&self) -> ColoredString
fn on_magenta(&self) -> ColoredString
fn on_cyan(&self) -> ColoredString
fn on_white(&self) -> ColoredString
fn on_rgb(&self, r: u8, g: u8, b: u8) -> ColoredString
fn bright_black(&self) -> ColoredString
fn bright_red(&self) -> ColoredString
fn bright_green(&self) -> ColoredString
fn bright_yellow(&self) -> ColoredString
fn bright_blue(&self) -> ColoredString
fn bright_magenta(&self) -> ColoredString
fn bright_cyan(&self) -> ColoredString
fn bright_white(&self) -> ColoredString
fn on_bright_black(&self) -> ColoredString
fn on_bright_red(&self) -> ColoredString
fn on_bright_green(&self) -> ColoredString
fn on_bright_yellow(&self) -> ColoredString
fn on_bright_blue(&self) -> ColoredString
fn on_bright_magenta(&self) -> ColoredString
fn on_bright_cyan(&self) -> ColoredString
fn on_bright_white(&self) -> ColoredString
Source§impl Debug for ColoredString
impl Debug for ColoredString
Source§impl Display for ColoredString
impl Display for ColoredString
Source§impl Hash for ColoredString
impl Hash for ColoredString
Source§impl PartialEq for ColoredString
impl PartialEq for ColoredString
impl Eq for ColoredString
impl StructuralPartialEq for ColoredString
Auto Trait Implementations§
impl Freeze for ColoredString
impl RefUnwindSafe for ColoredString
impl Send for ColoredString
impl Sync for ColoredString
impl Unpin for ColoredString
impl UnsafeUnpin for ColoredString
impl UnwindSafe for ColoredString
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