pub struct PrintTermcolor<T>(pub T);
Expand description
An adapter between the std::fmt::Write
trait and termcolor::WriteColor
.
Tuple Fields§
§0: T
Trait Implementations§
source§impl<T> Print for PrintTermcolor<T>where
T: WriteColor,
impl<T> Print for PrintTermcolor<T>where
T: WriteColor,
source§fn write_str(&mut self, s: &str) -> Result<()>
fn write_str(&mut self, s: &str) -> Result<()>
Writes the given string
s
in its entirety. Read moresource§fn start_name(&mut self) -> Result<()>
fn start_name(&mut self) -> Result<()>
Sets the colors settings for a name (
$foo
) to be printed.source§fn start_literal(&mut self) -> Result<()>
fn start_literal(&mut self) -> Result<()>
Sets the colors settings for literals (
"foo"
) to be printed.source§fn start_keyword(&mut self) -> Result<()>
fn start_keyword(&mut self) -> Result<()>
Sets the colors settings for a keyword (
(module ...)
) to be printed.source§fn start_type(&mut self) -> Result<()>
fn start_type(&mut self) -> Result<()>
Sets the colors settings for a type (
(param i32)
) to be printed.source§fn start_comment(&mut self) -> Result<()>
fn start_comment(&mut self) -> Result<()>
Sets the colors settings for a comment (
;; ...
) to be printed.source§fn reset_color(&mut self) -> Result<()>
fn reset_color(&mut self) -> Result<()>
Resets colors settings to the default.
source§fn supports_async_color(&self) -> bool
fn supports_async_color(&self) -> bool
Returns
true
if the device uses colors without interacting synchronously with a terminal (e.g. ANSI)source§fn start_line(&mut self, binary_offset: Option<usize>)
fn start_line(&mut self, binary_offset: Option<usize>)
Indicates that a new line in the output is starting at the
binary_offset
provided. Read moreAuto Trait Implementations§
impl<T> Freeze for PrintTermcolor<T>where
T: Freeze,
impl<T> RefUnwindSafe for PrintTermcolor<T>where
T: RefUnwindSafe,
impl<T> Send for PrintTermcolor<T>where
T: Send,
impl<T> Sync for PrintTermcolor<T>where
T: Sync,
impl<T> Unpin for PrintTermcolor<T>where
T: Unpin,
impl<T> UnwindSafe for PrintTermcolor<T>where
T: UnwindSafe,
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