pub struct ColorUtils;Expand description
ANSI color helpers shared by result formatters and test integration.
Implementations§
Source§impl ColorUtils
impl ColorUtils
Sourcepub fn supports_color() -> bool
pub fn supports_color() -> bool
Returns whether automatic color detection currently permits ANSI styling.
Sourcepub fn is_enabled(choice: ColorChoice) -> bool
pub fn is_enabled(choice: ColorChoice) -> bool
Resolves an explicit color choice to an enabled flag.
Sourcepub fn red_bold(text: impl AsRef<str>, choice: ColorChoice) -> String
pub fn red_bold(text: impl AsRef<str>, choice: ColorChoice) -> String
Makes text bold and red without nested reset sequences.
Sourcepub fn green_bold(text: impl AsRef<str>, choice: ColorChoice) -> String
pub fn green_bold(text: impl AsRef<str>, choice: ColorChoice) -> String
Makes text bold and green without nested reset sequences.
Trait Implementations§
Source§impl Clone for ColorUtils
impl Clone for ColorUtils
Source§fn clone(&self) -> ColorUtils
fn clone(&self) -> ColorUtils
Returns a copy 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 Debug for ColorUtils
impl Debug for ColorUtils
Source§impl Default for ColorUtils
impl Default for ColorUtils
Source§fn default() -> ColorUtils
fn default() -> ColorUtils
Returns the “default value” for a type. Read more
impl Copy for ColorUtils
Auto Trait Implementations§
impl Freeze for ColorUtils
impl RefUnwindSafe for ColorUtils
impl Send for ColorUtils
impl Sync for ColorUtils
impl Unpin for ColorUtils
impl UnwindSafe for ColorUtils
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