Trait termcolor::WriteColor [−][src]
pub trait WriteColor: Write { fn supports_color(&self) -> bool; fn set_color(&mut self, spec: &ColorSpec) -> Result<()>; fn reset(&mut self) -> Result<()>; }
This trait describes the behavior of writers that support colored output.
Required Methods
fn supports_color(&self) -> bool
Returns true if and only if the underlying writer supports colors.
fn set_color(&mut self, spec: &ColorSpec) -> Result<()>
Set the color settings of the writer.
Subsequent writes to this writer will use these settings until either
reset
is called or new color settings are set.
If there was a problem setting the color settings, then an error is returned.
fn reset(&mut self) -> Result<()>
Reset the current color settings to their original settings.
If there was a problem resetting the color settings, then an error is returned.
Implementations on Foreign Types
impl<'a, T: ?Sized + WriteColor> WriteColor for &'a mut T
[src]
impl<'a, T: ?Sized + WriteColor> WriteColor for &'a mut T
Implementors
impl WriteColor for StandardStream
impl<'a> WriteColor for StandardStreamLock<'a>
impl WriteColor for Buffer
impl<W: Write> WriteColor for NoColor<W>
impl<W: Write> WriteColor for Ansi<W>