pub struct AnsiValue(pub u8);
Expand description
An arbitrary ANSI color value.
Tuple Fields§
§0: u8
Implementations§
source§impl AnsiValue
impl AnsiValue
sourcepub fn grayscale(shade: u8) -> AnsiValue
pub fn grayscale(shade: u8) -> AnsiValue
Grayscale color.
There are 24 shades of gray.
Examples found in repository?
examples/rustc_fun.rs (line 20)
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
fn main() {
println!("{lighgreen}-- src/test/ui/borrow-errors.rs at 82:18 --\n\
{red}error: {reset}{bold}two closures require unique access to `vec` at the same time {reset}{bold}{magenta}[E0524]{reset}\n\
{line_num_fg}{line_num_bg}79 {reset} let append = |e| {{\n\
{line_num_fg}{line_num_bg}{info_line}{reset} {red}^^^{reset} {error_fg}first closure is constructed here\n\
{line_num_fg}{line_num_bg}80 {reset} vec.push(e)\n\
{line_num_fg}{line_num_bg}{info_line}{reset} {red}^^^{reset} {error_fg}previous borrow occurs due to use of `vec` in closure\n\
{line_num_fg}{line_num_bg}84 {reset} }};\n\
{line_num_fg}{line_num_bg}85 {reset} }}\n\
{line_num_fg}{line_num_bg}{info_line}{reset} {red}^{reset} {error_fg}borrow from first closure ends here",
lighgreen = color::Fg(color::LightGreen),
red = color::Fg(color::Red),
bold = style::Bold,
reset = style::Reset,
magenta = color::Fg(color::Magenta),
line_num_bg = color::Bg(color::AnsiValue::grayscale(3)),
line_num_fg = color::Fg(color::AnsiValue::grayscale(18)),
info_line = "| ",
error_fg = color::Fg(color::AnsiValue::grayscale(17)))
}
Trait Implementations§
impl Copy for AnsiValue
Auto Trait Implementations§
impl Freeze for AnsiValue
impl RefUnwindSafe for AnsiValue
impl Send for AnsiValue
impl Sync for AnsiValue
impl Unpin for AnsiValue
impl UnwindSafe for AnsiValue
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